OSDN Git Service

android-x86/bionic.git
9 years agoMerge "Replace NULL with nullptr"
Dmitriy Ivanov [Fri, 29 Aug 2014 22:30:07 +0000 (22:30 +0000)]
Merge "Replace NULL with nullptr"

9 years agoReplace NULL with nullptr
Dmitriy Ivanov [Fri, 29 Aug 2014 19:02:36 +0000 (12:02 -0700)]
Replace NULL with nullptr

Change-Id: Iad50be617d318ca98883b843229c960ad5b9afa9

9 years agoMerge "The host prebuilt glibc is 2.11, so remove workarounds for 2.9."
Elliott Hughes [Fri, 29 Aug 2014 18:12:36 +0000 (18:12 +0000)]
Merge "The host prebuilt glibc is 2.11, so remove workarounds for 2.9."

9 years agoMerge "Ignore all __weak_alias in OpenBSD libC."
Chih-Hung Hsieh [Fri, 29 Aug 2014 03:10:43 +0000 (03:10 +0000)]
Merge "Ignore all __weak_alias in OpenBSD libC."

9 years agoThe host prebuilt glibc is 2.11, so remove workarounds for 2.9.
Elliott Hughes [Fri, 29 Aug 2014 02:28:35 +0000 (19:28 -0700)]
The host prebuilt glibc is 2.11, so remove workarounds for 2.9.

Change-Id: I1072fcebc8b3018580a9d069fe6eca9c4e74e865

9 years agoMerge "Add GNU-compatible strerror_r."
Elliott Hughes [Fri, 29 Aug 2014 02:26:33 +0000 (02:26 +0000)]
Merge "Add GNU-compatible strerror_r."

9 years agoAdd GNU-compatible strerror_r.
Elliott Hughes [Tue, 19 Aug 2014 00:28:32 +0000 (17:28 -0700)]
Add GNU-compatible strerror_r.

We already had the POSIX strerror_r, but some third-party code defines
_GNU_SOURCE and expects to get the GNU strerror_r instead.

This exposed a bug in the libc internal logging functions where unlike
their standard brethren they wouldn't return the number of bytes they'd
have liked to have written.

Bug: 16243479
Change-Id: I1745752ccbdc569646d34f5071f6df2be066d5f4

9 years agoIgnore all __weak_alias in OpenBSD libC.
Chih-Hung Hsieh [Thu, 28 Aug 2014 18:47:48 +0000 (11:47 -0700)]
Ignore all __weak_alias in OpenBSD libC.

GCC assembler allows xyz to be redeclared as weak,
by __weak_alias(xyz, _xyz), while _xyz is undefined.
Clang does not like that but silently generates no code.
It will reject its own .s file if the assembly code is saved first.
Since we have no reason to define xyz or _xyz as weak symbol now,
and _xyz is a macro to xyz, we simplify libC to have only
xyz defined as global.

BUG: 17186746
Change-Id: I24b154425838683cae69248cc750c59e26fd5467

9 years agoMerge "Have pthread_attr_getstack for the main thread report RLIMIT_STACK..."
Elliott Hughes [Wed, 27 Aug 2014 23:43:26 +0000 (23:43 +0000)]
Merge "Have pthread_attr_getstack for the main thread report RLIMIT_STACK..."

9 years agoMerge "Replace snprintf calls in linker."
Christopher Ferris [Wed, 27 Aug 2014 23:29:18 +0000 (23:29 +0000)]
Merge "Replace snprintf calls in linker."

9 years agoMerge "Fix strlen function type for mips."
Chih-Hung Hsieh [Wed, 27 Aug 2014 23:07:54 +0000 (23:07 +0000)]
Merge "Fix strlen function type for mips."

9 years agoReplace snprintf calls in linker.
Christopher Ferris [Wed, 27 Aug 2014 03:48:11 +0000 (20:48 -0700)]
Replace snprintf calls in linker.

When enabling debug malloc, the snprintf calls in the linker fails to
update the buffer.

The problem is that snprintf makes a call to pthread_getspecific that
returns a valid pointer, but the data it points to is zero. This should
never happen and causes the snprintf to stop and do nothing.

Temporarily replace snprintf with a different implementation to work
around this issue.

Bug: 16874447
Bug: 17302493

(cherry pick from commit 172955a4e30b88ce8239a7ef426b4e8903e9923c)

Change-Id: Idca9d417978403d61debfd0434aaa82fd770f33b

9 years agoFix strlen function type for mips.
Chih-Hung Hsieh [Wed, 27 Aug 2014 21:13:09 +0000 (14:13 -0700)]
Fix strlen function type for mips.

Clang complains about incompatible-library-redeclaration.

BUG: 17302369
Change-Id: I3ae36f24846408c6464b84b5bddb1747e1e4a971

9 years agoMerge "Replace ambiguous cmp instruction with cmpl."
Chih-Hung Hsieh [Wed, 27 Aug 2014 22:46:06 +0000 (22:46 +0000)]
Merge "Replace ambiguous cmp instruction with cmpl."

9 years agoHave pthread_attr_getstack for the main thread report RLIMIT_STACK...
Elliott Hughes [Wed, 27 Aug 2014 22:32:01 +0000 (15:32 -0700)]
Have pthread_attr_getstack for the main thread report RLIMIT_STACK...

...rather than just what's already mapped in. This seems somewhat
contrary to POSIX's "All pages within the stack described by stackaddr
and stacksize shall be both readable and writable by the thread", but
it's what glibc does.

Bug: 17111575
Change-Id: If9e2dfad9a603c0d0615a8123aacda4946e95b2c

9 years agoReplace ambiguous cmp instruction with cmpl.
Chih-Hung Hsieh [Wed, 27 Aug 2014 22:04:23 +0000 (15:04 -0700)]
Replace ambiguous cmp instruction with cmpl.

Clang assembler rejects ambiguous cmp instruction.

BUG: 17302482
Change-Id: I74f49de87464541f9fe6fa288e4093a9fbf37120

9 years agoMerge "Add missing type casts before comparison."
Chih-Hung Hsieh [Wed, 27 Aug 2014 21:44:12 +0000 (21:44 +0000)]
Merge "Add missing type casts before comparison."

9 years agoMerge "Use the default unwind code."
Christopher Ferris [Wed, 27 Aug 2014 21:21:28 +0000 (21:21 +0000)]
Merge "Use the default unwind code."

9 years agoAdd missing type casts before comparison.
Chih-Hung Hsieh [Wed, 27 Aug 2014 20:45:37 +0000 (13:45 -0700)]
Add missing type casts before comparison.

BUG: 17300548
Change-Id: Ice9868f36c8fa8cd40bb13741b0e33c8f8d354fd

9 years agoUse the default unwind code.
Christopher Ferris [Tue, 26 Aug 2014 22:47:42 +0000 (15:47 -0700)]
Use the default unwind code.

This speeds up the debug malloc code by using the original unwinding code.
The only catch is that it has to link in the libc++ arm unwind code or
there will be crashes when attempting to unwind through libc++ compiled
code.

Bug: 16874447

(cherry picked from commit 3f7635f4906c53fa744731efc35235456b7d93bf)

Change-Id: If8a3821cdd95ed481bb496bf2daab449d13790f8

9 years agoMerge "call uselocale() before freelocale() to make sure that g_local_key has a valid...
Elliott Hughes [Wed, 27 Aug 2014 17:27:46 +0000 (17:27 +0000)]
Merge "call uselocale() before freelocale() to make sure that g_local_key has a valid locale."

9 years agocall uselocale() before freelocale() to make sure that g_local_key has a valid locale.
Wally Yau [Tue, 26 Aug 2014 16:47:23 +0000 (09:47 -0700)]
call uselocale() before freelocale() to make sure that g_local_key has a valid locale.

For tests that call uselocale(), the locale is stored in the
g_userlocale_key thread-specific key. If freelocale() is called later,
then g_uselocal_key points to a deleted pointer. CTS eventually calls
vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX
accesses the deleted locale stored in g_uselocale_key, causing unpredictable
errors.

Fixed the tests by calling uselocale() with the old locale before
calling freelocale.

(cherry-pick of 8a46cf0fcf82b8c76e05be7e066ec854f974603a.)

Bug: 17299565
Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c

9 years agoMerge "Switch to OpenBSD <err.h> implementation."
Elliott Hughes [Wed, 27 Aug 2014 17:26:02 +0000 (17:26 +0000)]
Merge "Switch to OpenBSD <err.h> implementation."

9 years agoSwitch to OpenBSD <err.h> implementation.
Elliott Hughes [Wed, 27 Aug 2014 00:00:37 +0000 (17:00 -0700)]
Switch to OpenBSD <err.h> implementation.

Change-Id: Ia950d88871a30f68e74f9ac7dbd87788e128e02f

9 years agoMerge "Undefine _Atomic before redefining"
Hans Boehm [Tue, 26 Aug 2014 23:34:49 +0000 (23:34 +0000)]
Merge "Undefine _Atomic before redefining"

9 years agoMerge "Switch to OpenBSD daemon(3)."
Elliott Hughes [Tue, 26 Aug 2014 23:33:43 +0000 (23:33 +0000)]
Merge "Switch to OpenBSD daemon(3)."

9 years agoSwitch to OpenBSD daemon(3).
Elliott Hughes [Tue, 26 Aug 2014 23:25:19 +0000 (16:25 -0700)]
Switch to OpenBSD daemon(3).

Change-Id: I1fd0be09fdb24aa6f1d945410eba5987f8a949b4

9 years agoMerge "More cases where libc should use O_CLOEXEC."
Elliott Hughes [Tue, 26 Aug 2014 23:23:58 +0000 (23:23 +0000)]
Merge "More cases where libc should use O_CLOEXEC."

9 years agoMore cases where libc should use O_CLOEXEC.
Elliott Hughes [Tue, 26 Aug 2014 23:20:59 +0000 (16:20 -0700)]
More cases where libc should use O_CLOEXEC.

Change-Id: Idfa111aeebc5deca2399dae919e8b72eb54c23c0

9 years agoMerge "Switch to OpenBSD res_random."
Elliott Hughes [Tue, 26 Aug 2014 23:18:04 +0000 (23:18 +0000)]
Merge "Switch to OpenBSD res_random."

9 years agoMerge "libc should use O_CLOEXEC when opening files for its own use."
Elliott Hughes [Tue, 26 Aug 2014 23:11:45 +0000 (23:11 +0000)]
Merge "libc should use O_CLOEXEC when opening files for its own use."

9 years agoMerge "Remove unnecessary calls to LinkedList::clear()"
Dmitriy Ivanov [Tue, 26 Aug 2014 23:00:43 +0000 (23:00 +0000)]
Merge "Remove unnecessary calls to LinkedList::clear()"

9 years agoUndefine _Atomic before redefining
Hans Boehm [Tue, 26 Aug 2014 22:58:15 +0000 (15:58 -0700)]
Undefine _Atomic before redefining

Stdatomic.h was potentially redefining _Atomic, in spite of a
prior definition by <atomic>.  This could cause g++ builds that
included <stdatomic.h> with an available <atomic> header to break.

Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8

9 years agolibc should use O_CLOEXEC when opening files for its own use.
Elliott Hughes [Tue, 26 Aug 2014 22:56:54 +0000 (15:56 -0700)]
libc should use O_CLOEXEC when opening files for its own use.

Change-Id: I159f1d57e0ca090d837f57854fcef5879b8b8248

9 years agoRemove unnecessary calls to LinkedList::clear()
Dmitriy Ivanov [Tue, 26 Aug 2014 22:56:31 +0000 (15:56 -0700)]
Remove unnecessary calls to LinkedList::clear()

Change-Id: I981d2700cb17322c634b751715543fd33ee49b7c

9 years agoMerge "Enable __cxa_atexit && __cxa_finalize for linker"
Dmitriy Ivanov [Tue, 26 Aug 2014 22:53:15 +0000 (22:53 +0000)]
Merge "Enable __cxa_atexit && __cxa_finalize for linker"

9 years agoEnable __cxa_atexit && __cxa_finalize for linker
Dmitriy Ivanov [Tue, 26 Aug 2014 21:16:52 +0000 (14:16 -0700)]
Enable __cxa_atexit && __cxa_finalize for linker

 This allows adding destructors to classes used
 for global variables.

Change-Id: I5e1cd63fe3bf8f66de88cc4f7437cafb350f49b5

9 years agoMerge "Fix pthread_getattr_np for the main thread."
Elliott Hughes [Tue, 26 Aug 2014 19:53:40 +0000 (19:53 +0000)]
Merge "Fix pthread_getattr_np for the main thread."

9 years agoFix pthread_getattr_np for the main thread.
Elliott Hughes [Tue, 26 Aug 2014 00:26:50 +0000 (17:26 -0700)]
Fix pthread_getattr_np for the main thread.

On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)

It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.

This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.

Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Change-Id: I1d4dbffe7bc7bda1d353c3a295dbf68d29f63158

9 years agoMerge "Add standard throw() spec to delete operators."
Chih-Hung Hsieh [Mon, 25 Aug 2014 22:08:32 +0000 (22:08 +0000)]
Merge "Add standard throw() spec to delete operators."

9 years agoAdd standard throw() spec to delete operators.
Chih-Hung Hsieh [Mon, 25 Aug 2014 19:08:19 +0000 (12:08 -0700)]
Add standard throw() spec to delete operators.

Without these specs, clang will reports mismatch between standard definitions and these declarations/definitions. These specs are ignored when compiled with -fno-exceptions.

BUG: 17136236
Change-Id: I386c712a61dc4fc74dfde45f9ec2d3d037f2e9f1

9 years agoMerge "Fix, generalize stdatomic.h; improve test."
Hans Boehm [Fri, 22 Aug 2014 22:52:31 +0000 (22:52 +0000)]
Merge "Fix, generalize stdatomic.h; improve test."

9 years agoFix, generalize stdatomic.h; improve test.
Hans Boehm [Tue, 19 Aug 2014 23:14:01 +0000 (16:14 -0700)]
Fix, generalize stdatomic.h; improve test.

We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing.  This generalizes the bionic header so that it
can be used directly as the prebuilt header as well.  So long as they
don't diverge again, that should somewhat improve test coverage.

Use the correct builtin for atomic_is_lock_free.

Fix atomic_flag_init.

Turn on atomic tests even with __GLIBC__, since they now appear to pass.

Include uchar.h in stdatomic.h where needed.

Add a basic memory ordering test.

Fix bit-rotted comments in bionic tests makefile.

Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68

9 years agoMerge "Bump soinfo version"
Dmitriy Ivanov [Fri, 22 Aug 2014 20:44:56 +0000 (20:44 +0000)]
Merge "Bump soinfo version"

9 years agoBump soinfo version
Dmitriy Ivanov [Fri, 22 Aug 2014 19:25:04 +0000 (12:25 -0700)]
Bump soinfo version

 This includes:
 1. Placing has_ifunc after fields with version = 0
 2. Switch to has_min_version(v) function.
 3. Minor soinfo initialization refactoring (placement new + ctor)

Change-Id: I1bf5fde4d930914012ce5f3ad5acb48217da9b2d

9 years agoMerge "Fix dlmalloc build."
Dan Albert [Fri, 22 Aug 2014 18:06:36 +0000 (18:06 +0000)]
Merge "Fix dlmalloc build."

9 years agoFix dlmalloc build.
Dan Albert [Fri, 22 Aug 2014 18:05:48 +0000 (11:05 -0700)]
Fix dlmalloc build.

Change-Id: Ied542c40867ab443cdd2076bd2e535b00c4854e4

9 years agoMerge "Implement malloc_info(3)."
Dan Albert [Fri, 22 Aug 2014 17:39:18 +0000 (17:39 +0000)]
Merge "Implement malloc_info(3)."

9 years agoImplement malloc_info(3).
Dan Albert [Wed, 20 Aug 2014 16:16:57 +0000 (09:16 -0700)]
Implement malloc_info(3).

Expose jemalloc stats through the malloc_info(3) interface.

Bug: 16874689
Change-Id: I4358ac283002e60ff161107028d1a3fb1e9afb0a

9 years agoMerge "Fix unistd.getpid_caching_and_clone."
Elliott Hughes [Fri, 22 Aug 2014 16:28:02 +0000 (16:28 +0000)]
Merge "Fix unistd.getpid_caching_and_clone."

9 years agoFix unistd.getpid_caching_and_clone.
Elliott Hughes [Fri, 22 Aug 2014 02:23:53 +0000 (19:23 -0700)]
Fix unistd.getpid_caching_and_clone.

This test only works if you're root (strictly: if you have permission to
CLONE_NEWNS), so it's useful to us when we're doing ad hoc testing (since
that's usually done as root), but it's not useful as part of CTS or when
running the tests on the host.

(cherry-pick of 84d0683a824fa02dbaa6d1b56a79223804b54e80.)

Bug: 16705621
Bug: 17170200
Change-Id: Ia92c871b15f7e45fc174bb59bc95540fd00ae745

9 years agoMerge "Remove _flush_cache(2) for mips64."
Dan Albert [Thu, 21 Aug 2014 21:51:41 +0000 (21:51 +0000)]
Merge "Remove _flush_cache(2) for mips64."

9 years agoMerge "Run constructors before resolving ifunc functions"
Dmitriy Ivanov [Thu, 21 Aug 2014 21:27:52 +0000 (21:27 +0000)]
Merge "Run constructors before resolving ifunc functions"

9 years agoRun constructors before resolving ifunc functions
Dmitriy Ivanov [Thu, 21 Aug 2014 20:54:03 +0000 (13:54 -0700)]
Run constructors before resolving ifunc functions

Bug: 17177284
Change-Id: I5714b9bc2d1ca8f8711806bfb68da3d524213e99

9 years agoRemove _flush_cache(2) for mips64.
Dan Albert [Thu, 21 Aug 2014 19:13:24 +0000 (12:13 -0700)]
Remove _flush_cache(2) for mips64.

Also remove declaration.

The only user is compiler-rt, and they can replace that call with one to
syscall(2). compiler-rt doesn't currently build on mips64 anyway.

Bug: 11156955
Change-Id: Ieae0ba49c8e7aa50253401fc1d7c2d17bc867d39

9 years agoMerge "__gnu_basename(3) is accounted for."
Dan Albert [Thu, 21 Aug 2014 19:14:44 +0000 (19:14 +0000)]
Merge "__gnu_basename(3) is accounted for."

9 years ago__gnu_basename(3) is accounted for.
Dan Albert [Thu, 21 Aug 2014 18:36:07 +0000 (11:36 -0700)]
__gnu_basename(3) is accounted for.

Change-Id: I3836b14a797c4a8d121c6d29d95791ac768257da

9 years agoMerge "Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream."
Elliott Hughes [Thu, 21 Aug 2014 02:39:34 +0000 (02:39 +0000)]
Merge "Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream."

9 years agoAdd POSIX-2008 fmemopen, open_memstream, and open_wmemstream.
Elliott Hughes [Wed, 20 Aug 2014 23:10:49 +0000 (16:10 -0700)]
Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream.

Bug: 17164505
Change-Id: I59e28a08ff8b6ab632230b11a5807cfd5278aeb5

9 years agoMerge "Simplify _ALIGN_TEXT."
Elliott Hughes [Wed, 20 Aug 2014 20:36:04 +0000 (20:36 +0000)]
Merge "Simplify _ALIGN_TEXT."

9 years agoSimplify _ALIGN_TEXT.
Elliott Hughes [Wed, 20 Aug 2014 20:11:58 +0000 (13:11 -0700)]
Simplify _ALIGN_TEXT.

Bug: 16872067
Change-Id: I2b622f252c21ce1b344c040f828ab3f4bf9b6c0a

9 years agoMerge "Regenerate "services.h" from /etc/services."
Elliott Hughes [Wed, 20 Aug 2014 19:21:54 +0000 (19:21 +0000)]
Merge "Regenerate "services.h" from /etc/services."

9 years agoRegenerate "services.h" from /etc/services.
Elliott Hughes [Wed, 20 Aug 2014 19:11:31 +0000 (12:11 -0700)]
Regenerate "services.h" from /etc/services.

Change-Id: Iec118f9a342b5c1f6ce6d48965798b12a7159ad3

9 years agoMerge "Clean up some of our python scripts."
Elliott Hughes [Wed, 20 Aug 2014 19:07:51 +0000 (19:07 +0000)]
Merge "Clean up some of our python scripts."

9 years agoClean up some of our python scripts.
Elliott Hughes [Wed, 20 Aug 2014 18:16:11 +0000 (11:16 -0700)]
Clean up some of our python scripts.

Change-Id: Ifa75345db43434298cfb6113fbe2f7a33b88c79d

9 years agoMerge "Add <stdio_ext.h> for elfutils."
Elliott Hughes [Wed, 20 Aug 2014 17:41:08 +0000 (17:41 +0000)]
Merge "Add <stdio_ext.h> for elfutils."

9 years agoAdd <stdio_ext.h> for elfutils.
Elliott Hughes [Wed, 20 Aug 2014 00:00:33 +0000 (17:00 -0700)]
Add <stdio_ext.h> for elfutils.

Bug: 17139679
Change-Id: I1605ac382dbb6f23b2d874dbb9769f3cde4a6a99

9 years agoMerge "Work around atomic_load(const T*) issues."
Hans Boehm [Tue, 19 Aug 2014 22:34:00 +0000 (22:34 +0000)]
Merge "Work around atomic_load(const T*) issues."

9 years agoWork around atomic_load(const T*) issues.
Hans Boehm [Tue, 19 Aug 2014 21:07:55 +0000 (14:07 -0700)]
Work around atomic_load(const T*) issues.

Bug:17067219
Change-Id: I78e753bcf03464f5f05c3f37e394f2727d282589

9 years agoMerge "Add in_port_t and move it and in_addr_t to the correct header file."
Elliott Hughes [Tue, 19 Aug 2014 20:11:53 +0000 (20:11 +0000)]
Merge "Add in_port_t and move it and in_addr_t to the correct header file."

9 years agoAdd in_port_t and move it and in_addr_t to the correct header file.
Elliott Hughes [Tue, 19 Aug 2014 19:43:50 +0000 (12:43 -0700)]
Add in_port_t and move it and in_addr_t to the correct header file.

No one's reported this, but I saw it in an Android port of fuser(1).

We still have lots of problems in our network headers because we
get most of the structs direct from the kernel, and it doesn't use
types like this (which is why we've got away without this one for
so long). One day we should probably look at cleaning that up, but
doing so can wait.

Change-Id: If15edf0cfc32716fa312d7ed97c48321b760d979

9 years agoMerge "Implement the GNU basename(3) in addition to the POSIX one."
Elliott Hughes [Tue, 19 Aug 2014 22:04:58 +0000 (22:04 +0000)]
Merge "Implement the GNU basename(3) in addition to the POSIX one."

9 years agoImplement the GNU basename(3) in addition to the POSIX one.
Elliott Hughes [Tue, 19 Aug 2014 21:30:30 +0000 (14:30 -0700)]
Implement the GNU basename(3) in addition to the POSIX one.

Code like perf(1) needs this.

Bug: 11860789
Change-Id: I907eb448052a7b165e4012d74303330d32328cb2

9 years agoMerge "Move the meat of <features.h> into <sys/cdefs.h>."
Elliott Hughes [Tue, 19 Aug 2014 18:55:17 +0000 (18:55 +0000)]
Merge "Move the meat of <features.h> into <sys/cdefs.h>."

9 years agoMove the meat of <features.h> into <sys/cdefs.h>.
Elliott Hughes [Tue, 19 Aug 2014 18:16:41 +0000 (11:16 -0700)]
Move the meat of <features.h> into <sys/cdefs.h>.

This way it's a lot harder for us to screw up (since we should always
be including <sys/cdefs.h> anyway).

Bug: 14659579
Change-Id: I23070fff3296b0d1c683bb5e3a6e214146327d53

9 years agoMerge "Remove unused defines from <features.h>."
Elliott Hughes [Tue, 19 Aug 2014 17:39:21 +0000 (17:39 +0000)]
Merge "Remove unused defines from <features.h>."

9 years agoRemove unused defines from <features.h>.
Elliott Hughes [Tue, 19 Aug 2014 17:07:00 +0000 (10:07 -0700)]
Remove unused defines from <features.h>.

Bug: 14659579
Change-Id: I2ab02b13cafe3faad31248b843d39ab2cdbfeb91

9 years agoMerge "Fix _BSD_SOURCE/__USE_BSD."
Elliott Hughes [Tue, 19 Aug 2014 16:48:43 +0000 (16:48 +0000)]
Merge "Fix _BSD_SOURCE/__USE_BSD."

9 years agoFix _BSD_SOURCE/__USE_BSD.
Elliott Hughes [Tue, 19 Aug 2014 16:18:03 +0000 (09:18 -0700)]
Fix _BSD_SOURCE/__USE_BSD.

Bug: 14659579
Change-Id: I80ec9584f054c02d1078828f6bca759c42bc1d4c

9 years agoMerge "Revert "Add support for protected local symbol lookup.""
Dmitriy Ivanov [Tue, 19 Aug 2014 16:45:34 +0000 (16:45 +0000)]
Merge "Revert "Add support for protected local symbol lookup.""

9 years agoRevert "Add support for protected local symbol lookup."
Dmitriy Ivanov [Mon, 18 Aug 2014 22:08:51 +0000 (15:08 -0700)]
Revert "Add support for protected local symbol lookup."

This reverts commit d97e9f546ea195686a78e539315b273393609b9e.

Bug: 17107521
(cherry picked from commit 9419420919ea846bbad5510850c7aaec95021648)

Change-Id: I1a6df946ac8075699e77d68ffa6ac4a21b88e4bf

9 years agoMerge "Missing #include <sys/cdefs.h>."
Dan Albert [Tue, 19 Aug 2014 18:29:31 +0000 (18:29 +0000)]
Merge "Missing #include <sys/cdefs.h>."

9 years agoMissing #include <sys/cdefs.h>.
Dan Albert [Tue, 19 Aug 2014 18:06:33 +0000 (11:06 -0700)]
Missing #include <sys/cdefs.h>.

Needed for __BEGIN_DECLS/__END_DECLS. Currently fine because it's being
included after other files that do this.

Change-Id: I1f12368fc461f6ef5ca90992cf19f317f0b5d7af

9 years agoMerge "Expose android_set_abort_message()."
Dan Albert [Tue, 19 Aug 2014 17:18:19 +0000 (17:18 +0000)]
Merge "Expose android_set_abort_message()."

9 years agoExpose android_set_abort_message().
Dan Albert [Mon, 18 Aug 2014 21:37:42 +0000 (14:37 -0700)]
Expose android_set_abort_message().

Removes the leading underscores from __android_set_abort_message() and
moves its declaration into a public header file.

Bug: 17059126
Change-Id: I470c79db47ec783ea7a54b800f8b78ecbe7479ab

9 years agoMerge "Fix leak_realloc, copy entire allocation."
Christopher Ferris [Mon, 18 Aug 2014 20:12:59 +0000 (20:12 +0000)]
Merge "Fix leak_realloc, copy entire allocation."

9 years agoFix leak_realloc, copy entire allocation.
Christopher Ferris [Sat, 16 Aug 2014 01:42:58 +0000 (18:42 -0700)]
Fix leak_realloc, copy entire allocation.

Bug: 16874447

(cherry picked from commit 5df0839cea98bd8c37d8dba5b94b98e99c681a94)

Change-Id: I9280505c0c1c3b5da24ba590448dcd6e7a230406

9 years agomalloc_usable_size returns the original size.
Christopher Ferris [Thu, 14 Aug 2014 19:48:04 +0000 (12:48 -0700)]
malloc_usable_size returns the original size.

Bug: 16874447

(cherry picked from commit 59c1ee44d0a560a754513fab12641c8a57a20d9e)

Change-Id: I70839632974367c8b9893fb1f9c5ee4364608470

9 years agoMerge "malloc_usable_size returns the original size."
Christopher Ferris [Mon, 18 Aug 2014 20:12:54 +0000 (20:12 +0000)]
Merge "malloc_usable_size returns the original size."

9 years agoMerge "Hide C++ stuff in libc. Put it back in libstdc++."
Dan Albert [Mon, 18 Aug 2014 19:56:41 +0000 (19:56 +0000)]
Merge "Hide C++ stuff in libc. Put it back in libstdc++."

9 years agoHide C++ stuff in libc. Put it back in libstdc++.
Dan Albert [Fri, 15 Aug 2014 21:20:04 +0000 (14:20 -0700)]
Hide C++ stuff in libc. Put it back in libstdc++.

Bug: 17062445
Change-Id: I027b186719654c2865b08c3fa83f90fa00c1e838

9 years agoMerge "Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE)."
Elliott Hughes [Tue, 19 Aug 2014 00:27:01 +0000 (00:27 +0000)]
Merge "Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE)."

9 years agoFix <features.h> (_BSD_SOURCE and _GNU_SOURCE).
Elliott Hughes [Mon, 18 Aug 2014 23:04:03 +0000 (16:04 -0700)]
Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE).

<features.h> is supposed to take user-settable stuff like _GNU_SOURCE
and _BSD_SOURCE and turn them into __USE_GNU and __USE_BSD for use in
the C library headers. Instead, bionic used to unconditionally define
_BSD_SOURCE and _GNU_SOURCE, and then test _GNU_SOURCE in the header
files (which makes no sense whatsoever).

Bug: 14659579
Change-Id: Ice4cf21a364ea2e559071dc8329e995277d5b987

9 years agoMerge "Improve <sys/cdefs.h>."
Elliott Hughes [Mon, 18 Aug 2014 22:11:55 +0000 (22:11 +0000)]
Merge "Improve <sys/cdefs.h>."

9 years agoImprove <sys/cdefs.h>.
Elliott Hughes [Mon, 18 Aug 2014 21:45:42 +0000 (14:45 -0700)]
Improve <sys/cdefs.h>.

Fix and use __RENAME (and lose ___RENAME --- two underscores should be
enough for anybody). This was the point of this change, because I want
to use __RENAME to support the two basename variants and the two
strerror_r variants.

Lose a bunch of macros that weren't being used.

Lose three dead files from the DNS code.

Change-Id: I3ef645c566b16a52217bc2e68c7d54b37c7c9522

9 years agoMerge "Add atexit test for attributed c-tor/d-tor"
Dmitriy Ivanov [Fri, 15 Aug 2014 22:57:37 +0000 (22:57 +0000)]
Merge "Add atexit test for attributed c-tor/d-tor"

9 years agoAdd atexit test for attributed c-tor/d-tor
Dmitriy Ivanov [Fri, 15 Aug 2014 21:22:07 +0000 (14:22 -0700)]
Add atexit test for attributed c-tor/d-tor

 1. Add test for __attribute__((constructor/destructor))
    and static constructor

 2. Compile C++ testlibs with -std=gnu++11

Change-Id: I67f9308144a0c638a51f111fcba8e1933fe0ba41

9 years agoMerge "Have stdatomic.h punt to C++ atomic when possible"
Hans Boehm [Fri, 15 Aug 2014 18:19:34 +0000 (18:19 +0000)]
Merge "Have stdatomic.h punt to C++ atomic when possible"

9 years agoHave stdatomic.h punt to C++ atomic when possible
Hans Boehm [Thu, 14 Aug 2014 22:26:03 +0000 (15:26 -0700)]
Have stdatomic.h punt to C++ atomic when possible

This is an alternate, somewhat simpler, fix that makes it safe to
include both <atomic> and <stdatomic.h> from C++ code in either order.
It means that C code consistently uses one implementation of atomics
and C++ another.  We still have to make sure that those two
implementations interoperate correctly at runtime; in particular,
any flavor of atomic object needs to be represented exactly like the
underlying type, with the proper alignment constraint.

Bug:17007799
Change-Id: Iffcfc5220d8fa150f89dd083a121b24d23f268fc

9 years agoMerge "Move mtctxres.c to libc_dns.a."
Dan Albert [Thu, 14 Aug 2014 23:17:17 +0000 (23:17 +0000)]
Merge "Move mtctxres.c to libc_dns.a."