Commit graph

6776 commits

Author SHA1 Message Date
Colin Cross
7a28a3cf1f malloc_debug: reset TrackData mutex after fork
Add a pthread_atfork handler to malloc_debug to lock the TrackData mutex
during fork and reset it in the child.  Ensures that the TrackData is
consistent when forking from a multi-threaded process, and that the
mutex is in a defined state in the child.

Change-Id: I0dfed30045a28551217ceac227d33b2e18894932
2016-02-12 16:41:14 -08:00
Elliott Hughes
cac2908b08 Fix regerror(..., nullptr, 0).
Found by passing a bad regular expression to the Google benchmark
code (https://github.com/google/benchmark).

Change-Id: I475db71c25706bbf02091b754acabe8254062f3a
2016-02-12 16:00:53 -08:00
Elliott Hughes
01b85d5df3 Set x86 TLS limit to 0xfffff, not PAGE_SIZE.
Not least because we set limit_in_pages to 1. PAGE_SIZE pages was never
anyone's intention.

Change-Id: Ide867f44a2fb20d4d5d0cd67ced468e8665a0193
2016-02-09 22:44:16 -08:00
Chih-hung Hsieh
4c3cf4ad4d Merge "Enable clang for x86_64 after fp128 fix in clang-2577113." 2016-02-09 01:27:01 +00:00
Chih-Hung Hsieh
63fedd76ad Enable clang for x86_64 after fp128 fix in clang-2577113.
Upstream LLVM fix was included in prebuilt clang-2577113.

BUG: 21899249
Change-Id: Ief3f3e28650c0bbf8749a5e5d26f45c39e15ed62
2016-02-08 17:07:33 -08:00
Elliott Hughes
b4931cee76 Update NOTICE files.
Change-Id: I6c4628534c5842c9835ead1bfff6582c5dce38e3
2016-02-08 17:00:12 -08:00
Mike Frysinger
9c212fc436 Merge "define pw_gecos to pw_passwd for LP32 systems" 2016-02-06 19:29:29 +00:00
Mike Frysinger
ca6af7f4a8 define pw_gecos to pw_passwd for LP32 systems
Since we set both fields to NULL all the time, we can alias the two
fields together on LP32 to provide build-time compatibility.

BUG=24918750
TEST=python now builds for Brillo boards

Change-Id: I3394aea80c9a5288669389f71d0e4132f2157e3c
2016-02-06 09:28:44 -05:00
Christopher Ferris
831c8a5249 Merge "Updated to v4.4.1 kernel headers." 2016-02-06 05:24:53 +00:00
Dan Willemsen
138a11c8a1 Merge "Update Android.bp" 2016-02-06 00:43:13 +00:00
Christopher Ferris
05d08e9716 Updated to v4.4.1 kernel headers.
Small modifications needed to allow compilation with the new headers:

- Manually modify bionic/libc/kernel/uapi/asm-mips/asm/siginfo.h to
  remove the uapi from the include.
- PR_XXX defines are now available for mips, so remove the definition
  from linker_mips.cpp.

Bug: 23789423
Change-Id: I6dc8a03b012426d3a937db15cb24d3a50fab5a8c
2016-02-05 16:03:55 -08:00
Dimitry Ivanov
b90837c3d3 Merge "Add check for pthread_self() when looking up a thread" 2016-02-05 04:29:54 +00:00
Dimitry Ivanov
4bc739a54c Add check for pthread_self() when looking up a thread
Check if thread_id is in fact pthread_self before
locking on g_thread_list_lock in __pthread_internal_find.

The main reason for doing this is not performance but to allow
the linker use raise() which was not working because pthread_kill()
couldn't find pthread_self() thread because the global thread
list is initialized in libc.so and the linker's version of this
list is empty.

Bug: http://b/25867917
Change-Id: I18fe620e8cd465b30f0e1ff45fff32958f3c5c00
2016-02-04 16:48:47 -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
Elliott Hughes
0c485dae70 Add in6addr_any and in6addr_loopback symbols.
Change-Id: I3a90fa448b6bd43321672ba74b84a4e9e8a67738
2016-02-03 14:13:52 -08:00
Elliott Hughes
5f26c6bc91 Really add adjtimex(2), and add clock_adjtime(2) too.
Change-Id: I81fde2ec9fdf787bb19a784ad13df92d33a4f852
2016-02-03 13:19:10 -08:00
Elliott Hughes
f226ee59e0 Add fopen64/freopen64/tmpfile64 aliases.
Our fopen/freopen/tmpfile are already always O_LARGEFILE, but let's add
the aliases for _LARGEFILE_SOURCE compatibility.

Bug: http://b/24807045
Change-Id: I5d99b3ef3c9f27ce70f13313f6a92e96c7f21f80
2016-02-03 11:24:28 -08:00
Elliott Hughes
e4fa6e9cc7 Expose ftello64.
Also add the missing test that would have caught this.

Bug: http://b/24807045
Change-Id: I756a4d825595b52396b15898e3f717156fd1ba2f
2016-02-02 22:39:15 -08:00
Xia Yang
6b45d57739 use GNU C89 extern inline semantics for __size_mul_overflow()
__size_mul_overflow generates warning under following compilation envrionment:

-OX -D_FORTIFY_SOURCE=2 (X=1, 2, 3)

For example:

echo '#include <stdio.h>' | \
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-gcc \
    -I bionic/libc/arch-arm/include \
    -I bionic/libc/include \
    -I bionic/libc/kernel/uapi \
    -I bionic/libc/kernel/common \
    -I bionic/libc/kernel/uapi/asm-arm \
    -I bionic/libm/include \
    -I bionic/libm/include/arm \
    -I bionic/libc/include \
    -Werror \
    -O1 \
    -D_FORTIFY_SOURCE=2 \
    -c \
    -x c \
    -

bionic/libc/include/stdio.h:360:13: error: '__size_mul_overflow' is
static but used in inline function 'fread' which is not static [-Werror]
         if (__size_mul_overflow(size, count, &total)) {
                          ^

C99 - 6.7.4
"An inline definition of a function with external linkage shall not contain
a definition of a modifiable object with static storage duration, and shall
not contain a reference to an identifier with internal linkage."

As standard does not require compiler to determine when it is safe to
reference an internal function in an external inline function, but instead
delegalizes such reference as a whole, gcc throws a warning for such code
under C99 compilation.  Warning produced by libc header is inhereted widely
and strips the option of using -Werror to track code sanity.

Replace static inline specifier with gnu89 extern inline. Latter "is used
only for inlining. In no case is the function compiled on its own", which
is slightly different from former semantically, but should produce the same
result here.

Change-Id: I6a3374498e5499d110e54468cf9d0d67d2debbe2
2016-02-02 17:28:16 -08:00
Christopher Ferris
701bb65511 Remove the unused TrackHeader structure.
Change-Id: I07ae5de717e1fcfbe5dfe552a531db9f630da622
2016-02-02 13:22:40 -08:00
Christopher Ferris
4821db1b3e Merge "Add better free tracking." 2016-02-02 20:40:36 +00:00
Greg Hackmann
5992e5fb6d Merge changes I8ca219fa,Ia92d35b1
* changes:
  socket.h: update AF_* constants
  Add adjtimex
2016-02-02 18:03:35 +00:00
Greg Hackmann
c7ca8f3a63 socket.h: update AF_* constants
Change-Id: I8ca219fa429ca8d8f872ed1db98275cd1a06f00b
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-02-02 00:28:35 +00:00
Christopher Ferris
7993b80f89 Add better free tracking.
Included in this change:

- Change the tag when a pointer is freed so it's easy to detect if
  an already freed pointer is being used.
- Move the free backtrace out of the header. This backtrace is only
  used under only some circumstances, so no need to allocate space
  in all headers for it.
- Add new option free_track_backtrace_num_frames to specify how many
  frames to record when the free occurs. This removes the dependency
  on the backtrace option to get backtraces.

Bug: 26739265
Change-Id: I76f5209507dcf46af67ada162a7cb2bf282116f2
2016-01-29 15:19:22 -08:00
Shinichiro Hamaji
37591462fa Merge "Tell kati about generated dependencies around crt" 2016-01-29 06:37:46 +00:00
Christopher Ferris
50647711eb Merge "Add min/max values for config values." 2016-01-29 02:31:07 +00:00
Greg Hackmann
3f3f6c526b Add adjtimex
Change-Id: Ia92d35b1851e73c9f157a749dba1e98f68309a8d
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-01-28 13:41:22 -08:00
Shinichiro Hamaji
3bcf094f21 Tell kati about generated dependencies around crt
This was a regression since kati has been introduced. Without
this, touching libc/arch-common/bionic/__dso_handle.h doesn't
let ninja rebuild object files.

Bug: 26839129
Change-Id: Ie9ef4559c0d1ff0910a4d250ea36938b291d15db
2016-01-28 19:39:50 +09:00
Christopher Ferris
166c8535a5 Add min/max values for config values.
This is to only allow realistic values for some of the options.

Bug: 26739265

Change-Id: I172d5401c27e5d638d80f1c93c678c26c4dae0fc
2016-01-27 18:13:09 -08:00
Dimitry Ivanov
fd799baf81 Merge changes I7dc213e9,I2928d682
* changes:
  Hide '__moddi3' symbol for x86 and mips
  Hide '__isthreaded' for lp64 libc.so
2016-01-27 23:36:18 +00:00
Dimitry Ivanov
ffaa2169d7 Hide '__moddi3' symbol for x86 and mips
Bug: http://b/26805673
Change-Id: I7dc213e9f25510a2a74a30e8c43fd7a64cb3dbdb
2016-01-27 15:12:19 -08:00
Dimitry Ivanov
aa2fd0fece Hide '__isthreaded' for lp64 libc.so
Bug: http://b/26805673
Change-Id: I2928d68287894be9f9ae7ed1858af512d8c80a3b
2016-01-27 14:54:36 -08:00
Christopher Ferris
2fc7f9db3d Remove unused file.
This file should have been deleted with the malloc debug rewrite, but
popped back into existence due to a merge conflict.

Change-Id: I74e53daaf3febf650b20e3da5329558ac84c5bcd
2016-01-27 10:58:36 -08:00
Elliott Hughes
955426ef79 Fix a sign extension bug in stdio.
This also lets us test the EOVERFLOW behavior, which pointed out that the
fgetpos/fsetpos return on failure has always been wrong...

Bug: http://b/24807045
Change-Id: I35273eb07c8c9155af858adb27569983397580b6
2016-01-26 18:25:52 -08:00
Tom Cherry
194860a9e6 Merge "Replace snprintf() with __libc_format_buffer()" 2016-01-27 00:09:52 +00:00
Tom Cherry
8352475c75 Replace snprintf() with __libc_format_buffer()
If snprintf() is called from the linker, it may erroneously return a
null string.  The libc internal __libc_format_buffer() does not have
this problem, so it is now used instead.

Bug: 26756577

Change-Id: I37a97e27f59b3c0a087f54a6603cc3aff7f07522
2016-01-26 23:51:01 +00:00
Elliott Hughes
896224aa7f Merge "Implement funopen64." 2016-01-26 23:26:43 +00:00
Elliott Hughes
a449fafc89 Merge "Fix lockf for LP32." 2016-01-26 22:56:36 +00:00
Dimitry Ivanov
3a33b52981 Merge "Move android_ network functions to LIBC_PRIVATE" 2016-01-26 22:47:56 +00:00
Elliott Hughes
03e65eb03b Implement funopen64.
Bug: http://b/24807045
Change-Id: I161920978161389be34b707cc6ce8e05f760d552
2016-01-26 14:45:13 -08:00
Dimitry Ivanov
97cb4fbed2 Move android_ network functions to LIBC_PRIVATE
Make following functions platform-private:
 android_getaddrinfofornet
 android_getaddrinfofornetcontext
 android_gethostbyaddrfornet
 android_gethostbynamefornet

Bug: http://b/26794226
Change-Id: I0855b0b82721e4d24e918508931b4d5587fcae7d
2016-01-26 14:44:00 -08:00
Elliott Hughes
d4ae54f668 Fix lockf for LP32.
Bug: http://b/13077650
Change-Id: Ibbe2d907d23791c908475e0875a5c745ac948813
2016-01-26 14:32:55 -08:00
Elliott Hughes
94bb0fab93 Merge "Support _FILE_OFFSET_BITS=64 for most of <stdio.h>." 2016-01-26 20:51:59 +00:00
Elliott Hughes
d9bb708575 Merge "Implement POSIX lockf." 2016-01-26 20:45:32 +00:00
Elliott Hughes
5704c423c8 Implement POSIX lockf.
This has been requested a few times over the years. This is basically
a very late rebase of https://android-review.googlesource.com/45470
which was abandoned years ago. One addition is that this version has
_FILE_OFFSET_BITS=64 support.

POSIX puts this in <unistd.h>. glibc also has it in <fcntl.h>.

Bug: http://b/13077650
Change-Id: I5862b1dc326e326c01ad92438ecc1578d19ba739
2016-01-26 11:09:44 -08:00
Elliott Hughes
9677fab88c Support _FILE_OFFSET_BITS=64 for most of <stdio.h>.
This doesn't address funopen, but does add fgetpos/fsetpos/fseeko/ftello.

Bug: http://b/24807045
Change-Id: Ibff6f00df5fb699c8e8f13b91a75caf024540b73
2016-01-26 09:14:41 -08:00
Yabin Cui
ca48274298 Revert "Revert "Make sem_wait able to return errno EINTR for sdk > 23.""
This reverts commit 6d51085202.
And add missing bionic_sdk_version.h.

Change-Id: I24cc738b1fd1d26234c52afbc787f5b3c4a9c9cb
2016-01-25 17:39:18 -08:00
Christopher Ferris
126cf324a3 Merge "Fix gcc test issues." 2016-01-26 01:35:03 +00:00
Christopher Ferris
1e185a5056 Fix gcc test issues.
Change-Id: I2b26b779f5198c7c9362a452b971260a8852aa7b
2016-01-25 17:27:40 -08:00
Elliott Hughes
ac67b4eb7c Merge "Revert "Make sem_wait able to return errno EINTR for sdk > 23."" 2016-01-26 00:32:38 +00:00
Dan Albert
6d51085202 Revert "Make sem_wait able to return errno EINTR for sdk > 23."
Broke the build. There's no such file as bionic_sdk_version.h anywhere in the tree.

This reverts commit 892b61d340.

Change-Id: Iec3f4588edfb1d1524bb5f16451fd05dc6ebe44a
2016-01-26 00:20:06 +00:00
Yabin Cui
c96b6e1747 Merge "Make sem_wait able to return errno EINTR for sdk > 23." 2016-01-25 23:39:29 +00:00
Christopher Ferris
e40e429753 Merge "Fix build for gcc." 2016-01-25 22:44:56 +00:00
Christopher Ferris
f2b67b85f5 Fix build for gcc.
Gcc doesn't like the brace object initialization, so make all of
the Feature objects explicit.

Also, no arguments to the error_log macros make gcc unhappy, so add
an option to turn these into warnings. These will be fixed when we
add the explicit _error and _warn log functions.

Change-Id: I35af834dabb5548923e893dd980a751fdebfa13a
2016-01-25 14:36:34 -08:00
Yabin Cui
892b61d340 Make sem_wait able to return errno EINTR for sdk > 23.
Posix standards says sem_wait is interruptible by the delivery
of a signal. To keep compatiblity with old apps, only fix that
in newer sdk versions.

Bug: 26743454

Change-Id: I924cbb436658e3e0f397c922d866ece99b8241a3
2016-01-25 13:44:39 -08:00
Christopher Ferris
0f7631fd92 Merge "Malloc debug rewrite." 2016-01-25 20:48:29 +00:00
Elliott Hughes
e70e0e9267 Move internal FILE flags macros to "local.h" from <stdio.h>.
Bug: http://b/24807045
Change-Id: Ia42ec1907370b4af957ece94a856f71c7ee27cb7
2016-01-25 11:10:47 -08:00
Christopher Ferris
63860cb8fd Malloc debug rewrite.
The major components of the rewrite:

- Completely remove the qemu shared library code. Nobody was using it
  and it appears to have broken at some point.
- Adds the ability to enable/disable different options independently.
- Adds a new option that can enable the backtrace on alloc/free when
  a process gets a specific signal.
- Adds a new way to enable malloc debug. If a special property is
  set, and the process has an environment variable set, then debug
  malloc will be enabled. This allows something that might be
  a derivative of app_process to be started with an environment variable
  being enabled.
- get_malloc_leak_info() used to return one element for each pointer that
  had the exact same backtrace. The new version returns information for
  every one of the pointers with same backtrace. It turns out ddms already
  automatically coalesces these, so the old method simply hid the fact
  that there where multiple pointers with the same amount of backtrace.
- Moved all of the malloc debug specific code into the library.
  Nothing related to the malloc debug data structures remains in libc.
- Removed the calls to the debug malloc cleanup routine. Instead, I
  added an atexit call with the debug malloc cleanup routine. This gets
  around most problems related to the timing of doing the cleanup.

The new properties and environment variables:

libc.debug.malloc.options
  Set by option name (such as "backtrace"). Setting this to a bad value
  will cause a usage statement to be printed to the log.

libc.debug.malloc.program
  Same as before. If this is set, then only the program named will
  be launched with malloc debug enabled. This is not a complete match,
  but if any part of the property is in the program name, malloc debug is
  enabled.

libc.debug.malloc.env_enabled
  If set, then malloc debug is only enabled if the running process has the
  environment variable LIBC_DEBUG_MALLOC_ENABLE set.

Bug: 19145921

Change-Id: I7b0e58cc85cc6d4118173fe1f8627a391b64c0d7
2016-01-25 10:54:21 -08:00
Elliott Hughes
ad9c3f34f7 Merge "Add _seek64 to FILE." 2016-01-25 18:50:41 +00:00
Josh Gao
c650447239 Merge "Remove dlmalloc." 2016-01-25 18:42:55 +00:00
Josh Gao
0ac0cee0d1 Remove dlmalloc.
Bug: http://b/17207577
Change-Id: Ie009badca6deb1f91b27a4340b70cdd6bedff893
2016-01-25 10:14:35 -08:00
Elliott Hughes
023c3071a0 Add _seek64 to FILE.
Move fdopen/fopen/freopen and change them to initialize _seek64 instead
of the legacy _seek. The in-memory streams can stick with _seek for now,
since you're not going to fit a > 4GiB in-memory stream on a 32-bit device
anyway.

Bug: http://b/24807045
Change-Id: I09dcb426817b571415ce24d4d15f364cdda395b3
2016-01-22 23:54:10 -08:00
Elliott Hughes
b877601bff Put struct FILE back how NDK-built apps expect it.
The first rule of stdio is you never change struct FILE. This broke all
NDK-built apps that used stdin/stdout/stderr. (Which is more than you
might think, given that those streams don't go anywhere useful. Svelte!)

I've added a big code comment because I knew when I removed the field that
doing so was a mistake, but I couldn't think why.

Bug: http://b/24807045
Bug: http://b/26747402
Change-Id: Ie1233586b223bb1cdf8e354c66d5ff23487a833a
2016-01-22 19:23:40 -08:00
Dimitry Ivanov
bba395492a Revert "Temporary apply LIBC version to __pthread_gettid"
This reverts commit 0ef1d121b5.

Bug: http://b/26392296
Bug: http://b/26391427
Change-Id: I7bbb555de3a43813e7623ff6ad4e17874d283eca
2016-01-22 01:43:04 +00:00
Dimitry Ivanov
05c2f6b3d3 Merge "libc: hide __signalfd4 symbol" 2016-01-22 01:41:27 +00:00
Dimitry Ivanov
90d2daec51 libc: hide fake_gmtime_r and fake_localtime_r
Bug: http://b/26274444
Change-Id: Icf96a00142a287d8d3466d2545e213e605601b42
2016-01-21 16:05:23 -08:00
Dimitry Ivanov
1a8732c232 libc: hide __signalfd4 symbol
Bug: http://b/26274444
Change-Id: Iaa2df640cac07e2e407ca11b9701ee9e11729146
2016-01-21 15:19:52 -08:00
Elliott Hughes
2704bd1340 Simplify fseek/ftell.
Another step towards _FILE_OFFSET_BITS=64 support.

Bug: http://b/24807045
Change-Id: I00b83c81a7b108176c4d9437bc32611f73b7e967
2016-01-21 10:34:35 -08:00
Elliott Hughes
5f1ff279ea Merge "Move stdio implementation details around a little." 2016-01-20 23:07:50 +00:00
Colin Cross
6dcab28311 Update Android.bp to match Android.mk
Change-Id: Ia14a7af94d6220b3078b8d37b76990454b16703c
2016-01-20 12:01:19 -08:00
Colin Cross
18dea9b8d4 Merge "Update Android.bp to match Android.mk" 2016-01-20 19:58:16 +00:00
Elliott Hughes
021335ebda Move stdio implementation details around a little.
Change-Id: I24594426d5479bdd55cbef0ab1b7d76c249dbd0c
2016-01-20 08:50:51 -08:00
Elliott Hughes
8b49f53a5e Merge "Make FILE*s less usable after fclose(3)." 2016-01-20 00:13:45 +00:00
Elliott Hughes
923f165b29 Make FILE*s less usable after fclose(3).
BSD doesn't invalidate the fd stored in struct FILE, which can make
it possible (via fileno(3), for example), to perform operations on
an fd you didn't intend to (rather than just failing with EBADF).

Fixing this makes the code slightly simpler anyway, and might help
catch bad code before it ships.

Bug: http://stackoverflow.com/questions/10816837/fclose-works-differently-on-android-and-linux
Change-Id: I9db74584038229499197a2695c70b58ed0372a87
2016-01-19 15:46:05 -08:00
Colin Cross
8ce38af73a Update Android.bp to match Android.mk
Change-Id: Ib6ab28c5b4569c9537c4647b3661166fdb82544a
2016-01-19 12:50:20 -08:00
Chih-Hung Hsieh
b43ee658bb Switch libc default to clang.
* Default to clang when USE_CLANG_PLATFORM_BUILD is not set
  and the target has no clang bug.

BUG: 26102335
Change-Id: Ied6c9dc5593bfbadbb8d8b38e66ea237d649bae5
2016-01-19 10:59:34 -08:00
Elliott Hughes
d1293faba6 Fix GCC build breakage.
Change-Id: I0339f525c68af942fb97f4bffc771717e67e0e07
2016-01-19 09:47:47 -08:00
Elliott Hughes
94ddc29c0e Merge "Add more fortify symbols to the expected differences from glibc." 2016-01-19 17:25:01 +00:00
Elliott Hughes
ed57b98758 Implement if_nameindex(3)/if_freenameindex(3).
This is just a subset of the recently-implemented getifaddrs(3), though if
we want to handle interfaces (such as "rmnet_*") that don't have an address,
we need to either expose ifaddrs_storage and keep track of which interfaces
we've already seen (which is pretty messy), or refactor the netlink code so
we can reuse it and just extract the information we need for if_nameindex(3).
This patch goes the latter route.

Also clean up if_nametoindex(3) and if_indextoname(3).

Change-Id: I5ffc5df0bab62286cdda2e7af06f032c767119a8
2016-01-18 12:07:38 -08:00
Elliott Hughes
d07c4434f1 Add more fortify symbols to the expected differences from glibc.
Change-Id: I6266b2e6cbea3c014b4ea30a7100186965e40cf1
2016-01-15 19:54:31 -08:00
Elliott Hughes
68d0150221 Merge "Sync with upstream OpenBSD." 2016-01-16 03:02:06 +00:00
Elliott Hughes
506c6deff7 Sync with upstream OpenBSD.
Also some minor build cleanup.

Change-Id: Ibd20602d7ea45685f0c47fceb00ffd6c7ae35954
2016-01-15 16:30:18 -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
Dimitry Ivanov
126d5ab779 Merge "Revert "Move __system_property* to LIBC_PRIVATE for lp64 libc"" 2016-01-13 20:35:25 +00:00
Dimitry Ivanov
e1078a939a Revert "Move __system_property* to LIBC_PRIVATE for lp64 libc"
This reverts commit ff14fb5a1f.

Bug: http://b/26497521
Change-Id: Id7131b37a31e936db0e72ef9969e1f13d2dd578f
2016-01-13 20:32:12 +00:00
Colin Cross
2487f3e15f Merge "Rearrange build files to support USE_SOONG=true" 2016-01-13 20:32:09 +00:00
Dan Willemsen
5d10e69bea Merge "Fix Soong x86 atom builds" 2016-01-13 20:32:07 +00:00
Colin Cross
c292f57ec7 Merge "Update Android.bp for changes to Android.mk" 2016-01-13 20:31:39 +00:00
Dan Willemsen
701b54533b Fix Soong x86 atom builds
Change-Id: Ie92e605c499f128335a8da7cfefa7e6ae367a223
2016-01-12 19:45:57 -08:00
Elliott Hughes
9361ad3f80 Fix <sys/sysmacros.h>.
1. The definitions were wrong.
2. The definitions were inline functions.
3. The definitions were polluting the namespace even for code that doesn't
   want BSD cruft.

Note that everybody will still get these by default, because you still get
all the BSD stuff by default.

Bug: http://b/12706131
Change-Id: I062ecd09feef7a6e8ba1922d465b96a9c4bf4f4e
2016-01-12 14:43:27 -08:00
Colin Cross
c23aeb8414 Rearrange build files to support USE_SOONG=true
Building with USE_SOONG=true will build with an Android.bp file if it is
present in the directory, otherwise an Android.mk file.  Only a few of
the bionic directories compile with soong, so include all of them from
the top level Android.mk file and remove the top level Android.bp file.
Individual subdirectories with Android.bp files will use soong with
USE_SOONG=true.

Change-Id: Idf8d7977ea4668fa646be25b543bf9d3773de615
2016-01-12 13:42:21 -08:00
Chih-hung Hsieh
2c7d1e67e0 Merge "Explicit binary op order for both gcc and clang/llvm." 2016-01-12 19:41:46 +00:00
Chih-Hung Hsieh
592c7b4cd7 Explicit binary op order for both gcc and clang/llvm.
* gcc assembler parses (1 << n - 1) as ((1 << n) - 1)
* llvm assembler parses (1 << n - 1) as (1 << (n - 1))

BUG: 26289334
Change-Id: Iaaa3d07f59c0f87cb1b80b9a1c4e765b66846791
2016-01-12 09:48:09 -08:00
Colin Cross
a3f9fca568 Update Android.bp for changes to Android.mk
Change-Id: Ie01e326e2776c699237b156155610d08801c0cd4
2016-01-11 15:34:24 -08:00
Yi Kong
fdb2963e0a Handle AF_PACKET in getifaddr(3).
Also fix a bug where we were mutating the address/broadcast address
of an existing entry rather than the new entry, and use 'const' to
ensure we don't make that mistake again.

Change-Id: I31c127a5d21879b52c85cd0f7ed2e66554a21e39
2016-01-08 19:18:44 -08:00
Elliott Hughes
195b85a80f Merge "Defend against -fstack-protector in libc startup." 2016-01-08 18:54:01 +00:00
Dimitry Ivanov
6d142bcf34 Move __aeabi* symbols to LIBC_N version
We had these symbols incorrectly versioned as LIBC_PRIVATE
in M release. This change moves __aeabi* symbols from LIBC
to LIBC_N and adds __gnu_Unwind_Find_exidx to the list

Bug: https://github.com/android-ndk/ndk/issues/1
Change-Id: I0b353012adeacb00ae29ea10c63b9d1cf1cadbe7
2016-01-08 10:13:16 -08:00
Elliott Hughes
42d949ff9d Defend against -fstack-protector in libc startup.
Exactly which functions get a stack protector is up to the compiler, so
let's separate the code that sets up the environment stack protection
requires and explicitly build it with -fno-stack-protector.

Bug: http://b/26276517
Change-Id: I8719e23ead1f1e81715c32c1335da868f68369b5
2016-01-06 20:06:08 -08:00