Commit graph

255 commits

Author SHA1 Message Date
mspector
dd91b32baf Removing the kuser_helper elf note from building
This change removes the kuser_helper note from building automatically
with any binary but leaves the note.
Also fixes a typo in the note.

Original patch adding the note:
Ib8366e2a0810092b71381d57dee4bdaa56369a24

Bug: 34815073
Test: Manual - Note is no longer added to binaries
Change-Id: Ieb81f9d9127d1f8a522434a31c696d743238e2a5
2017-02-09 18:37:52 -08:00
David James
a187a6f12e Merge "Revert "Remove the global thread list."" 2017-02-02 02:46:40 +00:00
Elliott Hughes
7484c21c4c Revert "Remove the global thread list."
This reverts commit b0e8c565a6.

Breaks swiftshader (http:/b/34883464).

Change-Id: I7b21193ba8a78f07d7ac65e41d0fe8516940a83b
2017-02-02 02:41:38 +00:00
Elliott Hughes
9b9d4ebc8b Merge "Remove the global thread list." 2017-02-01 16:16:41 +00:00
Elliott Hughes
f8562c5f8f Remove backwards compatibility for old system properties.
No-one is directly upgrading from pre-K to O...

Also move more implementation details out of the header file.

Bug: http://b/33926793
Test: boots
Change-Id: I7a0936acbb1cea8a3b2cd6797ec53ba7e4a050f3
2017-01-27 16:19:59 -08:00
mspector
2e3d6a1d67 Adding kuser_helper on note to all arm32 binaries.
A kernel change is going in for 64bit arm to disable kuser_helper vector
pages for 32bit processes.  This change adds a special elf note to
all arm32 binaries built with bionic.  This note tells the kernel to
load the kuser_helper vector page for the process.

Bug: 33689037
Test: Manual - Phone boots, 32bit binaries have the notes, 64bit
binaries do not.
Change-Id: Ib8366e2a0810092b71381d57dee4bdaa56369a24
2017-01-25 17:33:05 -08:00
Colin Cross
35bbed8020 Declare dependency on android_filesystem_config.h
android_filesystem_config.h comes from a directory outside bionic/libc
so it can't be referenced directly, add it as a source file through
a filegroup module.

Bug: 34283327
Test: builds
Test: libc rebuilds after touch system/core/include/private/android_filesystem_config.h
Change-Id: I90f6b7b25b70842b8619d558074449f13e6e6b03
2017-01-17 18:31:33 -08:00
Elliott Hughes
940d460f59 Merge "Revert "Revert "move android_ids into bionic""" 2017-01-10 01:15:30 +00:00
Elliott Hughes
b0e8c565a6 Remove the global thread list.
Another release, another attempt to fix this bug.

This change affects pthread_detach, pthread_getcpuclockid,
pthread_getschedparam/pthread_setschedparam, pthread_join, and pthread_kill:
instead of returning ESRCH when passed an invalid pthread_t, they'll now SEGV.

Note that this doesn't change behavior as much as you might think: the old
lookup only held the global thread list lock for the duration of the lookup,
so there was still a race between that and the dereference in the caller,
given that callers actually need the tid to pass to some syscall or other,
and sometimes update fields in the pthread_internal_t struct too.

We can't check thread->tid against 0 to see whether a pthread_t is still
valid because a dead thread gets its thread struct unmapped along with its
stack, so the dereference isn't safe.

Taking the affected functions one by one:

* pthread_getcpuclockid and pthread_getschedparam/pthread_setschedparam
  should be fine. Unsafe calls to those seem highly unlikely.

* Unsafe pthread_detach callers probably want to switch to
  pthread_attr_setdetachstate instead, or using pthread_detach(pthread_self())
  from the new thread's start routine rather than doing the detach in the
  parent.

* pthread_join calls should be safe anyway, because a joinable thread won't
  actually exit and unmap until it's joined. If you're joining an
  unjoinable thread, the fix is to stop marking it detached. If you're
  joining an already-joined thread, you need to rethink your design.

* Unsafe pthread_kill calls aren't portably fixable. (And are obviously
  inherently non-portable as-is.) The best alternative on Android is to
  use pthread_gettid_np at some point that you know the thread to be alive,
  and then call kill/tgkill directly. That's still not completely safe
  because if you're too late, the tid may have been reused, but then your
  code is inherently unsafe anyway.

If we find too much code is still broken, we can come back and disable
the global thread list lookups for anything targeting >= O and then have
another go at really removing this in P...

Bug: http://b/19636317
Test: N6P boots, bionic tests pass
Change-Id: Ia92641212f509344b99ee2a9bfab5383147fcba6
2017-01-07 14:16:46 -08:00
Elliott Hughes
3f6eee9793 Revert "Revert "move android_ids into bionic""
This reverts commit 77cb68d9f2.

Change-Id: Ibc9f775c4cd418be90fd8a6f192dd72ca5dff09a
2016-12-13 23:47:25 +00:00
Christopher Ferris
8b3e812684 Merge "libc: ARM64: update memset/strlen/memcpy/memmove to newlib/cortex-strings" 2016-12-13 23:11:27 +00:00
Treehugger Robot
50ae6dde5b Merge "Revert "move android_ids into bionic"" 2016-12-13 00:31:25 +00:00
Elliott Hughes
77cb68d9f2 Revert "move android_ids into bionic"
This reverts commit 1a13db5b26.

Change-Id: I7f571b3a9d542694d16fb9cf1131ef9e59d330ea
2016-12-12 22:11:37 +00:00
Elliott Hughes
ded6c91acc Merge "move android_ids into bionic" 2016-12-10 00:13:05 +00:00
Dimitry Ivanov
fc0d48078a loader: stop linking libdl/c/m into the loader
This is to prevent situations when libgcc.a calls into incorrect
implementation of dl_iterate_phdr.

Bug: http://b/27106625
Test: build && run bionic-unit-tests --getst_filter=dl*:Dl*
Change-Id: I4cba8c4a156f91f17ba3d95c39cb80f9b70c9d8f
2016-12-06 11:15:24 -08:00
Elliott Hughes
68ddf5cad3 Merge "Abort harder." 2016-11-30 23:06:26 +00:00
William Roberts
1a13db5b26 move android_ids into bionic
Generate the android_ids array and include into the
build.

Test: The bionic is built and that core AIDs work as
expected with commands like chown, mkdir and init services
and builtins.
Bug: 27999086
Change-Id: Ib575bf85326c91801c5674db475dcb9cf44c00dc
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-11-30 12:54:08 -08:00
Treehugger Robot
f563ae89be Merge "Ship all the UAPI bits." 2016-11-30 19:43:30 +00:00
Elliott Hughes
4bf5522662 Abort harder.
Some PoS internal system can't cope with more than 4 stack frames,
so the fact that our abort(3) implementation takes 4 frames by itself
makes it useless.

Re-reading POSIX, it only says "behaves as if", so the previous
implementation chain wasn't mandatory and we can just go straight to
calling tgkill...

Before:

     #00 pc 0000000000069be4  /system/lib64/libc.so (tgkill+8)
     #01 pc 0000000000066d50  /system/lib64/libc.so (pthread_kill+64)
     #02 pc 0000000000028110  /system/lib64/libc.so (raise+24)
     #03 pc 000000000001d4ec  /system/lib64/libc.so (abort+52)

After:

     #00 pc 0000000000069bc8  /system/lib64/libc.so (tgkill+8)
     #01 pc 000000000001d4c8  /system/lib64/libc.so (abort+80)
     #02 pc 0000000000001494  /system/xbin/crasher64 (_ZL9do_actionPKc+872)
     #03 pc 00000000000010e0  /system/xbin/crasher64 (main+88)

This is less useful on 32-bit ARM because there there's an extra trampoline
from an assembler abort(3) implementation, so you'll still only get one
meaningful stack frame. But every other architecture will now get two!

But wait!

It turns out that the assembler hack isn't needed any more. Here we are
unwinding just fine all the way through the 32-bit ARM crasher:

Before (with direct call to tgkill but still using the assembler):

     #00 pc 00049e7c  /system/lib/libc.so (tgkill+12)
     #01 pc 00019c6f  /system/lib/libc.so (__libc_android_abort+50)
     #02 pc 000181f8  /system/lib/libc.so (abort+4)
     #03 pc 00001025  /system/xbin/crasher (_ZL9do_actionPKc+656)
     #04 pc 00017721  /system/lib/libc.so (__libc_init+48)
     #05 pc 00000b38  /system/xbin/crasher (_start+96)

After:

     #00 pc 00049e6c  /system/lib/libc.so (tgkill+12)
     #01 pc 00019c5f  /system/lib/libc.so (abort+50)
     #02 pc 00001025  /system/xbin/crasher (_ZL9do_actionPKc+656)
     #03 pc 00017721  /system/lib/libc.so (__libc_init+48)
     #04 pc 00000b38  /system/xbin/crasher (_start+96)

(As you can see, the fact that we see __libc_init rather than main was true
with the assembler stub too, so that's not a regression even if it does seem
odd...)

Bug: N/A
Test: ran crasher64
Change-Id: I9dd5b214c495604c8b502c7ec0de3631080d8c29
2016-11-29 22:02:25 -08:00
Treehugger Robot
609880c12f Merge "Fix getpriority/setpriority types." 2016-11-30 05:49:03 +00:00
Dan Willemsen
b99b6762b4 Merge "Enable libc/libdl/libm/linker for host bionic" 2016-11-30 05:32:06 +00:00
Elliott Hughes
8f0e42fda6 Fix getpriority/setpriority types.
Bug: N/A
Test: builds
Change-Id: Ica099bae04a0260871783452811a54672094ba4a
2016-11-29 15:14:11 -08:00
Elliott Hughes
bd734f0716 Merge "Use icu4c to implement <wctype.h>." 2016-11-29 23:05:31 +00:00
Dan Willemsen
7ec52b12ef Enable libc/libdl/libm/linker for host bionic
Disables debuggerd integration unless building for android.

Bug: 31559095
Test: Diff out/soong/build.ninja before/after, only change is moving
      linker's libdebuggerd_client static lib to the beginning of the
      list.
Test: lunch aosp_arm64-eng; mmma -j bionic
Change-Id: I62e725f7a9b98b7fe31637d0a835fd5846b0aff0
2016-11-29 21:09:05 +00:00
Elliott Hughes
a57ca0da69 Use icu4c to implement <wctype.h>.
Pretty useless, because the POSIX APIs are useless for actually
internationalization, but it lets us put this to bed for good.

Bug: http://b/18492914
Test: bionic tests
Change-Id: I4dd0aff66c44b5547039be3ffea806c865b9014a
2016-11-29 19:19:30 +00:00
Dan Albert
063e86ace8 Ship all the UAPI bits.
Test: make ndk
Bug: None
Change-Id: I24507846fb62b5844e06d7a424497a5ffc0357d1
2016-11-29 11:17:58 -08:00
Elliott Hughes
86841573ed Merge "Implement <langinfo.h>." 2016-11-29 19:16:09 +00:00
Christopher Ferris
ecebb49ac6 Add cortex-a7 specific routines.
Test: Changed angler target to use cortex-a7 and I compiled.
Test: Booted this version on angler and ran bionic-unit-tests.

Change-Id: Ice7f6ea38a2569582161a8e659d7877918c1a45a
2016-11-28 12:49:36 -08:00
Jake Weinstein
372f19e9e2 libc: ARM64: update memset/strlen/memcpy/memmove to newlib/cortex-strings
* Bionic benchmarks results at the bottom

* This is a squash of the following commits:

libc: ARM64: optimize memset.

 This is an optimized memset for AArch64.  Memset is split into 4 main
 cases: small sets of up to 16 bytes, medium of 16..96 bytes which are
 fully unrolled.  Large memsets of more than 96 bytes align the
 destination and use an unrolled loop processing 64 bytes per
 iteration.  Memsets of zero of more than 256 use the dc zva
 instruction, and there are faster versions for the common ZVA sizes 64
 or 128.  STP of Q registers is used to reduce codesize without loss of
 performance.

Change-Id: I0c5b5ec5ab8a1fd0f23eee8fbacada0be08e841f

libc: ARM64: improve performance in strlen

Change-Id: Ic20f93a0052a49bd76cd6795f51e8606ccfbf11c

libc: ARM64: Optimize memcpy.

 This is an optimized memcpy for AArch64.  Copies are split into 3 main
 cases: small copies of up to 16 bytes, medium copies of 17..96 bytes
 which are fully unrolled.  Large copies of more than 96 bytes align
 the destination and use an unrolled loop processing 64 bytes per
 iteration.  In order to share code with memmove, small and medium
 copies read all data before writing, allowing any kind of overlap.  On
 a random copy test memcpy is 40.8% faster on A57 and 28.4% on A53.

Change-Id: Ibb9483e45bbc0e8ca3d5ce98a31c55dfd8a5ac28

libc: AArch64: Tune memcpy

* Further tuning for performance.

Change-Id: Id08eaab885f9743fa7575077924a947c1b88e4ff

libc: ARM64: optimize memmove for Cortex-A53

* Sadly does not work on Denver or Kryo, so can't go to generic

 This is an optimized memmove for AArch64.  All copies of up to 96
 bytes and all backward copies are done by the new memcpy.  The only
 remaining case is large forward copies which are done in the same way
 as the memcpy loop, but copying from the end rather than the start.

Tested on the Nextbit Robin with MSM8992 (Snapdragon 808):

Before
BM_string_memcmp/8                          1000k         27    0.286 GiB/s
BM_string_memcmp/64                           50M         20    3.053 GiB/s
BM_string_memcmp/512                          20M        126    4.060 GiB/s
BM_string_memcmp/1024                         10M        234    4.372 GiB/s
BM_string_memcmp/8Ki                        1000k       1726    4.745 GiB/s
BM_string_memcmp/16Ki                        500k       3711    4.415 GiB/s
BM_string_memcmp/32Ki                        200k       8276    3.959 GiB/s
BM_string_memcmp/64Ki                        100k      16351    4.008 GiB/s
BM_string_memcpy/8                          1000k         13    0.612 GiB/s
BM_string_memcpy/64                         1000k          8    7.187 GiB/s
BM_string_memcpy/512                          50M         38   13.311 GiB/s
BM_string_memcpy/1024                         20M         86   11.858 GiB/s
BM_string_memcpy/8Ki                           5M        620   13.203 GiB/s
BM_string_memcpy/16Ki                       1000k       1265   12.950 GiB/s
BM_string_memcpy/32Ki                        500k       2977   11.004 GiB/s
BM_string_memcpy/64Ki                        500k       8003    8.188 GiB/s
BM_string_memmove/8                         1000k         11    0.684 GiB/s
BM_string_memmove/64                        1000k         16    3.855 GiB/s
BM_string_memmove/512                         50M         57    8.915 GiB/s
BM_string_memmove/1024                        20M        117    8.720 GiB/s
BM_string_memmove/8Ki                          2M        853    9.594 GiB/s
BM_string_memmove/16Ki                      1000k       1731    9.462 GiB/s
BM_string_memmove/32Ki                       500k       3566    9.189 GiB/s
BM_string_memmove/64Ki                       500k       7708    8.501 GiB/s
BM_string_memset/8                          1000k         16    0.487 GiB/s
BM_string_memset/64                         1000k         16    3.995 GiB/s
BM_string_memset/512                          50M         37   13.489 GiB/s
BM_string_memset/1024                         50M         58   17.405 GiB/s
BM_string_memset/8Ki                           5M        451   18.160 GiB/s
BM_string_memset/16Ki                          2M        883   18.554 GiB/s
BM_string_memset/32Ki                       1000k       2181   15.022 GiB/s
BM_string_memset/64Ki                        500k       4563   14.362 GiB/s
BM_string_strlen/8                          1000k          8    0.965 GiB/s
BM_string_strlen/64                         1000k         16    3.855 GiB/s
BM_string_strlen/512                          20M         92    5.540 GiB/s
BM_string_strlen/1024                         10M        167    6.111 GiB/s
BM_string_strlen/8Ki                        1000k       1237    6.620 GiB/s
BM_string_strlen/16Ki                       1000k       2765    5.923 GiB/s
BM_string_strlen/32Ki                        500k       6135    5.341 GiB/s
BM_string_strlen/64Ki                        200k      13168    4.977 GiB/s

After
BM_string_memcmp/8                          1000k         21    0.369 GiB/s
BM_string_memcmp/64                         1000k         28    2.272 GiB/s
BM_string_memcmp/512                          20M        128    3.983 GiB/s
BM_string_memcmp/1024                         10M        234    4.375 GiB/s
BM_string_memcmp/8Ki                        1000k       1732    4.728 GiB/s
BM_string_memcmp/16Ki                        500k       3485    4.701 GiB/s
BM_string_memcmp/32Ki                        500k       7031    4.660 GiB/s
BM_string_memcmp/64Ki                        200k      14296    4.584 GiB/s
BM_string_memcpy/8                          1000k          5    1.458 GiB/s
BM_string_memcpy/64                         1000k          7    8.952 GiB/s
BM_string_memcpy/512                          50M         36   13.907 GiB/s
BM_string_memcpy/1024                         20M         80   12.750 GiB/s
BM_string_memcpy/8Ki                           5M        572   14.307 GiB/s
BM_string_memcpy/16Ki                       1000k       1165   14.053 GiB/s
BM_string_memcpy/32Ki                        500k       3141   10.430 GiB/s
BM_string_memcpy/64Ki                        500k       7008    9.351 GiB/s
BM_string_memmove/8                           50M          7    1.074 GiB/s
BM_string_memmove/64                        1000k          9    6.593 GiB/s
BM_string_memmove/512                         50M         37   13.502 GiB/s
BM_string_memmove/1024                        20M         80   12.656 GiB/s
BM_string_memmove/8Ki                          5M        573   14.281 GiB/s
BM_string_memmove/16Ki                      1000k       1168   14.018 GiB/s
BM_string_memmove/32Ki                      1000k       2825   11.599 GiB/s
BM_string_memmove/64Ki                       500k       6548   10.008 GiB/s
BM_string_memset/8                          1000k          7    1.038 GiB/s
BM_string_memset/64                         1000k          8    7.151 GiB/s
BM_string_memset/512                        1000k         29   17.272 GiB/s
BM_string_memset/1024                         50M         53   18.969 GiB/s
BM_string_memset/8Ki                           5M        424   19.300 GiB/s
BM_string_memset/16Ki                          2M        846   19.350 GiB/s
BM_string_memset/32Ki                       1000k       2028   16.156 GiB/s
BM_string_memset/64Ki                        500k       4514   14.517 GiB/s
BM_string_strlen/8                          1000k          7    1.120 GiB/s
BM_string_strlen/64                         1000k         16    3.918 GiB/s
BM_string_strlen/512                          50M         64    7.894 GiB/s
BM_string_strlen/1024                         20M        104    9.815 GiB/s
BM_string_strlen/8Ki                           5M        664   12.337 GiB/s
BM_string_strlen/16Ki                       1000k       1291   12.682 GiB/s
BM_string_strlen/32Ki                       1000k       2940   11.143 GiB/s
BM_string_strlen/64Ki                        500k       6440   10.175 GiB/s

Change-Id: I635bd2798a755256f748b2af19b1a56fb85a40c6
2016-11-28 19:35:12 +00:00
Elliott Hughes
fc8e688c32 Implement <langinfo.h>.
POSIX locale only, as usual.

The GNU YESSTR and NOSTR extensions return the empty string in the C locale,
so I haven't bothered supporting them.

Bug: http://b/1401872
Test: bionic tests
Change-Id: I6846839e4f9f1812344ed5dce0b93f83c0c20eb3
2016-11-19 11:46:54 -08:00
Colin Cross
4ce94d297e Don't pack relocations in libc.so
Ic9125cc1bc4c9ba9eb20d030de72e3ce1fb86fa6 disabled relocation packing
in libc.so, but the flag was dropped when we switched to Android.bp
in Ib0ba2d28bff88483b505426ba61606da314e03ab.

Bug: 20645321
Bug: 20655855
Bug: 32750616
Test: builds
Test: inspect out/build-aosp_angler.ninja
Test: run app that crashes with packed libc.so
Change-Id: Ib0630f2e342afa543bb88303fec8f9695ac583e9
2016-11-15 15:35:31 -08:00
Josh Gao
a170d9bfc5 Revert "Revert "Attempt to use arc4random where getauxval(AT_RANDOM) is used.""
This reverts commit 60d052dda6.

Bug: http://b/27729263
Change-Id: I7f32dc9f9a1f21fda3213f10da940821e1bdd63f
2016-11-10 17:02:45 -08:00
Dan Albert
9259265fc2 Add license to ndk_headers modules.
Test: make ndk
Bug: None
Change-Id: I0e9a39def2be9cd81369843906f6d7c180d17045
2016-10-20 11:52:05 -07:00
Dan Albert
df31aff4e9 Migrate libstdc++ to ndk_library.
Test: make checkbuild
Bug: http://b/30465923
Change-Id: I3b75b4e7fa652c83846c5978f9908e8b32d43aa7
2016-10-06 15:50:41 -07:00
Colin Cross
7b29495d0a Update escaping in Android.bp files
Strings like cflags in Android.bp files are parsed by blueprint,
written to build.ninja files, parsed by ninja, and then passed to
/bin/sh -c.  This had resulted in a combination of blueprint
(\"), ninja ($$), and shell (\$) escaping being necessary.

Soong has been updated to automatically handle ninja and shell
escaping, remove extra escaping from Android.bp files.

Bug: 31221587
Test: m -j
Change-Id: Ib58a51dee8d22296b69ec21768ba6a49dd60e980
2016-09-29 14:37:30 -07:00
Dan Albert
bae16ef1bb Add missing uapi header module.
Test: make checkbuild tests
Bug: http://b/30465923
Change-Id: I4000a9f7aa7ede03dfe799cea7c890bd5dcda575
2016-09-14 17:16:33 -07:00
Dan Albert
4238a35007 Add modules for NDK headers and libraries.
Test: make checkbuild
Bug: http://b/27533932
Change-Id: I285e483ba9fb80cc3baf0d025c85344e5b79a08b
2016-09-13 14:16:14 -07:00
Elliott Hughes
7f0849fd11 Fix sscanf/wcstod parsing of NaNs.
The parsefloat routines -- which let us pass NaNs and infinities on to
strto(f|d|ld) -- come from NetBSD.

Also fix LP64's strtold to return a NaN, and fix all the architectures
to return quiet NaNs.

Also fix wcstof/wcstod/wcstold to use parsefloat so they support hex
floats.

Lots of new tests.

Bug: http://b/31101647
Change-Id: Id7d46ac2d8acb8770b5e8c445e87cfabfde6f111
2016-09-07 15:01:54 -07:00
Josh Gao
60d052dda6 Revert "Attempt to use arc4random where getauxval(AT_RANDOM) is used."
This reverts commit 78a52f19bb.

Change-Id: Ia72501ad0b81e894d67e5ce59b597397c11acfa5
2016-09-02 05:48:11 +00:00
Josh Gao
78a52f19bb Attempt to use arc4random where getauxval(AT_RANDOM) is used.
When arc4random can get entropy (which is true for basically everyone
but init on kernels that don't support getrandom), use it instead of
AT_RANDOM.

Bug: http://b/29622562
Change-Id: I6932803af2c477e65562ff531bd959f199fad1df
2016-08-31 18:01:05 -07:00
Elliott Hughes
e19c672a06 Revert "Switch back to the BSD exec for now."
This reverts commit 18c31d7f4c.

63615066d9 fixed the bug.

Change-Id: I1d59c4be6ad1a05b23dce0198737f0789d7e034a
2016-08-26 16:15:57 +00:00
Elliott Hughes
18c31d7f4c Switch back to the BSD exec for now.
Bug: http://b/31091962
Change-Id: Ia155c4aa0d6db7b91d7486433c3c01a841b0e509
2016-08-25 17:25:31 -07:00
Treehugger Robot
fac56897f8 Merge "Rewrite the exec family." 2016-08-24 21:21:43 +00:00
Elliott Hughes
1b40aafe3f Rewrite the exec family.
* Removes duplication.
* Removes fixed PATH_MAX limit.
* Adds basic tests.

Bug: http://b/30032507
Change-Id: I4087a9de3e53884ac3297ebafbec4e6f8a9871b6
2016-08-24 13:03:04 -07:00
Elliott Hughes
7d4e28a486 Merge "Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>." 2016-08-18 23:58:43 +00:00
Elliott Hughes
7c59f3f6f3 Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>.
Also fix <sys/ipc.h>.

Not useful except to systems/bringup folks for testing. Trivial tests
added, and double-checked under strace to see that things look right.

x86 -- which works differently to everything else -- tested on the host.

Bug: http://b/27952303
Change-Id: I328534e994ae9e90755f545478fba03038c0bb94
2016-08-18 15:23:38 -07:00
Elliott Hughes
8e547bde4b Be more restrictive about max frame size.
exec and realpath both have PATH_MAX buffers (which is a bug in its own
right, since PATH_MAX isn't a real limit). The printf/scanf implementation
has a few large functions, and the DNS implementation is a complete 1970s
C nightmare.

Bug: http://b/30032507
Change-Id: I4b9daa552123c16bbe84f0632b2b32eba17a9dbd
2016-08-16 15:57:47 -07:00
Elliott Hughes
cae33ade6c Fix memmem behavior with empty needles.
Change-Id: I8b893d80c27b548652d843af9520d7adc8ba8902
2016-08-16 12:28:58 -07:00
Treehugger Robot
299e501419 Merge "Move brillo closer to Android." 2016-08-10 23:59:19 +00:00
Elliott Hughes
5ffed9b856 Move brillo closer to Android.
Hiding our legacy cruft seemed like a good idea, but in practice it will only
mean worse interoperability.

Plus we got it wrong, as the recent `putw` example showed.

Change-Id: I167c7168eff133889028089c22a7a0dfb8d6d0cf
2016-08-10 14:08:31 -07:00
Elliott Hughes
fb3873d4db Fortify vsnprintf in more cases.
Bug: http://b/30445072
Change-Id: I1893890f0e3b56533eef053eda1bd96a0b9a5119
2016-08-10 11:50:12 -07:00
Elliott Hughes
53cf348c82 Remove more stdio copy/paste.
Change-Id: Ia92629b75d2c153ecf1cec711e2f9575eef604ab
2016-08-09 16:27:23 -07:00
Elliott Hughes
d1f25a7eb1 Reimplement remove(3) without the lstat(2).
This assumes that it's more likely we're unlinking a file than a directory,
though even if that's not true, as long as a failed unlink(2) is cheaper
than a successful lstat(2) -- which seems likely since there's no data to
copy -- we still win.

Change-Id: I0210e9cd3d31b8cf1813c55c810262ef327382ed
2016-08-05 15:53:03 -07:00
Elliott Hughes
70715da453 More stdio one-liners.
This actually turns up a bug in fmemopen, so I guess that's what I'll
look at next...

Change-Id: I2971ecd1b5a3a3c7f43c22d985f88e389af89e97
2016-08-01 18:06:38 -07:00
Elliott Hughes
cceaf069c7 More stdio cleanup.
Time to get back to cleaning up stdio, so start with a bunch of easy
one-liners...

Change-Id: I8df5fdc72500a89b977bfaa6c64c3639198d4e3e
2016-07-29 16:31:52 -07:00
Elliott Hughes
0a610d00fe Upgrade to tzcode-2016f.
No significant changes other than a default implementation of strftime_l.

Change-Id: I6edd2c03e5e7559f012c0c87d43f7109d641d3ca
2016-07-29 14:04:17 -07:00
Dimitry Ivanov
6cc8d47a1f Add symbol versions to libstdc++.so
Bug: http://b/28987948
Change-Id: I3853528bd432ceab37e4867f2c4112d9ee0b40dc
2016-07-28 13:52:17 -07:00
Elliott Hughes
f47514dd99 Remove __LIBC_ABI_PUBLIC__.
We have much better control over visibility now, so we don't need to
pollute the headers with cruft.

Bug: http://b/24767418
Change-Id: I349f4c3bc30102477375ad9f80926e560c7c1d8b
2016-07-19 13:56:46 -07:00
Colin Cross
baa4899d38 Convert malloc_debug from Android.mk to Android.bp
Change-Id: I60ad376d222a92a29263c2804dcd1bd0d3c383d0
2016-07-14 09:07:56 -07:00
Pirama Arumuga Nainar
b2f5a58866 Revert "Skip Clang's integrated-as for hand-coded assembly"
This reverts commit 8d414dd2b1.

Reverting this since https://android-review.googlesource.com/#/c/244800/ adds -fno-integrated-as globally.

Change-Id: I29f53a385c16f44ead5dc744b0f2dd18a4af1731
2016-06-30 00:16:54 +00:00
Pirama Arumuga Nainar
8d414dd2b1 Skip Clang's integrated-as for hand-coded assembly
Bug: http://b/28149048
Bug: http://b/29771478

Clang recently switched to using integrated assembler for Mips.
However, it fails to compile some of the hand-coded assembly files in
bionic.  Disable integrated-as for the time being.

Change-Id: I2eed4391f6827224da74383387bdd9105de5a857
2016-06-27 15:09:05 -07:00
Elliott Hughes
449eff02d2 Add futimes, futimesat, and lutimes.
Spotted these while cleaning up <sys/cdefs.h> --- if we remove __USE_XOPEN2K8,
libchrome decides you "must" have futimes. Adding the missing functions (all
just alternative interfaces to utimensat(2) system call) lets us clean up
without breaking anything.

Change-Id: If44fab08ee3de0e31066d650d128a3c96323529b
2016-06-08 19:51:20 -07:00
Elliott Hughes
816fab9538 Just use libstdc++ for the cxa stuff inside bionic.
We have an explicit link map now, so we don't need a separate copy of libstdc++
that's built with -fvisibility=hidden.

Bug: http://b/29009180
Change-Id: I2d794d62f52621e6ad258ca6d455f9bd3830d829
2016-05-27 17:57:46 -07:00
Colin Cross
5a22d3e13d Force clang for bionic
Bionic will only compile with clang, and Android.mk files force clang,
turn it on in Android.bp.

Change-Id: I9db06298adfeab4eeef031d88aa310776cad3af0
2016-05-18 14:06:22 -07:00
Dan Willemsen
0c6570817f Update Android.bp to match Android.mk
* Remove --exclude-libs ldflags (e29e99c51)
* Mips strlen check was inverted
* ARM specific libc changes only apply to the shared library
* Reorder libjemalloc and malloc_common to match Make's ordering (for
  better binary diffing)

Change-Id: Ib41bd47565b1e8fadd285daa7b337cff1edd0808
2016-05-12 13:34:35 -07:00
Colin Cross
37f3632806 Update strip property format
Change-Id: Ic95655d25753b2c0f056a5660d42f582f90abe74
2016-04-29 14:06:14 -07:00
Colin Cross
ee84786bfc Update Android.bp to match Android.mk
Change-Id: I6b71d8ee91c550e2d37c88ce2ca088964639d433
2016-04-29 14:06:14 -07:00
Dimitry Ivanov
e5ed43beff Remove -fvisibility=hidden from dns code
We no longer need it because version script controls
list of symbols we export.

This also fixes mips/mips64 builds.

Bug: http://b/24767418
Change-Id: I61c504665fc0349275384596d375155991743e05
2016-04-28 11:38:33 -07:00
Colin Cross
bd26f23c84 Merge "Update sanitize property format" 2016-04-19 22:42:04 +00:00
Elliott Hughes
13d79abebe Fix ftw/nftw to only report unreadable directories once.
Also remove all the copy & paste.

Bug: http://b/28197840
Change-Id: Ia43e9ffd838dabb511a6e54403d6f62066383e4d
2016-04-18 12:05:18 -07:00
Colin Cross
27c43c505e Update sanitize property format
Change-Id: I2fd35d6d85c7da7e96ffcefcd81350c836f0db9c
2016-04-15 16:36:13 -07:00
Colin Cross
77d57bf7e1 Rename deps property to objs in cc_objects
The deps property is handled by blueprint, which doesn't give the
flexibilty of handling it within soong.  Switch to using objs instead.

Change-Id: Iddc25b0ba03fe79ba0533ef6fde33a5e71bcc8f0
2016-04-11 14:52:14 -07:00
Colin Cross
fc8ed2fe8e Update Android.bp to match Android.mk
Change-Id: I002242ab36b6d0d8ad833543c07945f64175a613
2016-04-11 14:52:13 -07:00
Colin Cross
eccca04769 Merge "Update Android.bp to match Android.mk" 2016-04-11 21:23:56 +00:00
Colin Cross
b839610500 Update Android.bp to match Android.mk
Change-Id: I0d9bb2b98838184856da81499a64334e0b554617
2016-04-07 13:24:50 -07:00
Elliott Hughes
6cfb84b97e Add trivial no-op <nl_types.h>.
Needed to build OpenMP.

Bug: http://b/27617302
Change-Id: Iac15c84ead6f5d5274cfdb2d6d4a4ec0072244bb
2016-04-06 17:22:44 -07:00
Elliott Hughes
26fda778f7 Fix b64_pton.
This was fixed upstream years ago. While we're here, let's switch to the
OpenBSD copy (because that's our majority upstream BSD, not because they
found and fixed this bug first).

Bug: http://b/28035006
Change-Id: I53dd915a8122bfd7a6d58f01f9902d1586a47e23
2016-04-06 12:08:45 -07:00
Elliott Hughes
e4510a2779 Break up the rest of stubs.cpp.
Bug: http://b/27999086
Change-Id: Ibcc2c5171d43ebd26b486642052738473f3b7714
2016-04-06 08:34:58 -07:00
Mark Salyzyn
b38347ad8b bionic: split out getpwnam and friends
- added grp_pwd.cpp containing POSIX passwd and group functions,
  colocated because they share with the Android ID (AID) roots.
- stubs.cpp contains all the truly empty functions (network and
  protocol accessors)

Bug: 27999086
Change-Id: I036f9e2dd246f48302cb7c97d23176fa24d19c33
2016-04-06 07:26:01 -07:00
Dan Willemsen
be45b22a51 Update Android.bp with recent Android.mk changes
This ports Idb3d445e053c44180773f59774df19b324f6817f to Android.bp

Change-Id: Id5cdb450330792810b8eb61b3cab115ef046e55d
2016-04-04 13:20:31 -07:00
Dan Willemsen
23aae1ce30 Update Android.bp with getdomainname
Change-Id: I32383162acd16430089708fdce8927be43d1bc5a
2016-03-29 15:21:38 -07:00
Dan Willemsen
a27d8c3094 Update Android.bp with recent *.mk changes
Change-Id: I01acce3b0018d838c4765881c19f5f009721370f
2016-03-03 15:41:14 -08:00
Dan Willemsen
879cec2770 Update Android.bp with recent Android.mk changes
Change-Id: If9777e9ece6de1bc00c3ef86724c7bd4d437aaca
2016-02-29 10:37:56 -08:00
Dan Willemsen
3e62171516 Update Android.bp
Also reorders some arch-specific sources to match the order in the
Android.mk system.

Change-Id: Ibde46a7cef9840b759be796ce9ac6618d3b06532
2016-02-03 21:48:08 -08:00
Colin Cross
6dcab28311 Update Android.bp to match Android.mk
Change-Id: Ia14a7af94d6220b3078b8d37b76990454b16703c
2016-01-20 12:01:19 -08:00
Colin Cross
8ce38af73a Update Android.bp to match Android.mk
Change-Id: Ib6ab28c5b4569c9537c4647b3661166fdb82544a
2016-01-19 12:50:20 -08:00
Dan Willemsen
9c9aa74970 Align Soong builds closer to Make
This moves the Android.bp file to use wildcards in the same places that
they're using in the Android.mk file. It also fixes a file that was in a
different order.

Make and Soong still produce binaries with object files in different
orders, but that's due to Make reordering the object files based on
compile type. Soong keeps the original specified order. It's not
possible to emulate the reordered files in the Android.bp, since the
arch-specific files won't interleave properly.

Change-Id: I9052b3ed7c523c13df5cbe606f913c32c88c7c5f
2016-01-15 16:06:25 -08:00
Dan Willemsen
e4f486ca25 Fix Soong mips builds
Change-Id: I6ae8208e077d831969b08e7abd232deaa20ceca1
2016-01-13 23:22:22 -08:00
Dan Willemsen
4031cbe9c2 Fix Soong x86 builds
Change-Id: Ida3f3584f832d61caf7200557ea57be799eaf38e
2016-01-13 13:37:01 -08:00
Dan Willemsen
5d10e69bea Merge "Fix Soong x86 atom builds" 2016-01-13 20:32:07 +00:00
Dan Willemsen
701b54533b Fix Soong x86 atom builds
Change-Id: Ie92e605c499f128335a8da7cfefa7e6ae367a223
2016-01-12 19:45:57 -08:00
Colin Cross
a3f9fca568 Update Android.bp for changes to Android.mk
Change-Id: Ie01e326e2776c699237b156155610d08801c0cd4
2016-01-11 15:34:24 -08:00
Josh Gao
63a42070fc Kill BOARD_MALLOC_ALIGNMENT.
Bug: http://b/26403338
Change-Id: Iba4006277fdb7c7ca60542c517634ae86c847b4f
2016-01-06 14:30:26 -08:00
Dan Willemsen
9b59acc9c7 libc: Update Android.bp with recent changes
Change-Id: I54047df9db95169452bbac6d52c75161d2f3bb64
2016-01-05 14:32:54 -08:00
Yabin Cui
9b687dc243 Enable using clang to build __cxa_thread_atexit_impl.
Remove previous workaround as we no longer use
__thread in __cxa_thread_atexit_impl.cpp.

Change-Id: Ic1062995db488859b341acdda0b5f6635e10d7e8
2015-11-30 14:43:52 -08:00
Colin Cross
bff87d19f1 Remove cflags and ldflags from crt defaults
After ToolchainCflags were added to soong crt no longer needs to try to
recreate the bare minimum cflags for compiling for each architecture.
Also always use GCC to match crt.mk

Change-Id: I01a833ab70d989033c84f072e3660d060189688c
2015-11-24 11:11:02 -08:00
Colin Cross
6ab8f89d1c move arch variant structs down a level
Use blueprint's new anonymous embedded struct feature to move the arch
variant properties down a level, replacing arch.cortex_a9.srcs with
arch.arm.cortex_a9.srcs, while still supporting top-level properties
like arch.arm.srcs.

Change-Id: Ib41c80e3549440d5efdfd293a15cffa3f51a0fe4
2015-11-23 14:14:57 -08:00
Colin Cross
a35d23d251 Update libc/Android.bp to match libc/Android.mk
Change-Id: I4dfadc55688213f095949c56306e5071b2ab6135
2015-11-19 14:18:06 -08:00
Dan Willemsen
dc6b0a7b93 Update Android.bp with latest Android.mk changes
Change-Id: I45f6292fcc4d4559519d88f948b4478204b08f25
2015-11-09 14:03:46 -08:00
Colin Cross
50c21ab47d Use cc_defaults
Use a cc_defaults module to reduce duplication.

Change-Id: Iaee6bf20b84123babcdc68d4feb06308f5f61a59
2015-11-03 17:25:36 -08:00
Dan Willemsen
9e6f98fe9d Update Android.bp with arch-specific version scripts
Change-Id: I59b34f21b54e8a2084bb318a08c4092064f48083
2015-11-03 14:30:57 -08:00
Dan Willemsen
268a673bd1 Switch to LOCAL_SRC_FILES_EXCLUDE
This moves the generic arm/arm64/x86 settings into the main makefiles
and makes the rest of them derivatives. This better aligns with how
soong handles arch/cpu variants.

Also updates the Android.bp to make it consistent with the make
versions.

Change-Id: I5a0275d992bc657459eb6fe1697ad2336731d122
2015-10-20 11:58:28 -07:00
Dmitriy Ivanov
280d54680d Fix bug number for linker related workarounds
Bug: 24425865
Change-Id: I2021674a9df0e768f312ca024d906302db1c494f
2015-09-28 10:31:12 -07:00
Dan Willemsen
35e91a10e0 Update Android.bp for setjmp cookies
Change-Id: I57245e4eedf9b8e1edc7de46208be5aa47c94b28
2015-09-17 15:28:45 -07:00
Dan Willemsen
208ae17e5f Add Android.bp for libc/libm/libdl
Change-Id: I3537363849ba1244348996ff17c5ace1b95dbeee
2015-09-16 16:50:01 -07:00