History log of /bionic/libc/Android.mk
Revision Date Author Comments
5e58ea07d47c175abf8285ff67e3e9bc0b3a9e8e 12-Sep-2012 Nick Kralevich <nnk@google.com> libc: add ftw / nftw functions

Please see "man 3 ftw" for a description of the
ftw / nftw functions.

This code is taken directly from netbsd unmodified.

Change-Id: Ia4879ac57212b424adf5281b5e92858e216d0f14
b5f053b5a7deb084e7a052d527e0aa41339ae05c 08-Sep-2012 Irina Tirdea <irina.tirdea@intel.com> Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3).

Change-Id: I426109db25e907980d6cb3a7a695796e45783b78
e007775f4b21f6b94078ed1d34b753435ba28fda 10-Sep-2012 Pavel Chupin <pavel.v.chupin@intel.com> Add libdl into libc_malloc_debug_leak build

Otherwise libc_malloc_debug_leak.so is failed to load runtime in x86
case

Change-Id: I8207ce06d1ec17b233f4e4fcfdd2b161673b4fa8
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
12949e5d3946cc5d5b53d52adf5a3b925bfca2c6 10-Sep-2012 Elliott Hughes <enh@google.com> Rename crtstart variables as crtbegin, to match reality.

No functional change, but it's confusing that the variable
names don't match the filenames.

Change-Id: I7109f917797be2f056e69fddb92e4a7306281813
cf464878efda7652b0a7eb636e45944eda6b6f2f 08-Sep-2012 Ying Wang <wangying@google.com> Generate header dependency makefiles for the crt*.o

Bug: 7127743
Change-Id: I606e5f7cd2b513f855a1fefd2b001abd365fc854
c4d1fecc105063e68a5090a6900b63d1b9a24287 28-Aug-2012 Elliott Hughes <enh@google.com> Clean up warnings in the malloc_debug_* files.

Also clean up cpplint.py-detected lint.

Change-Id: Ia18e89c4c6878764f8d7ed34b8247e7a8d8fe88b
2c344d3631eaad4bcfec821ea0e9f158c537a686 29-Aug-2012 Ian Rogers <irogers@google.com> Revert "Revert "Upgrade to dlmalloc 2.8.5.""

This reverts commit f72ee269274170cd46af2844a2fe88767fb6e43c.
f3cfcd869ded41d25c1f4f4e48e7c374a64f9583 21-Aug-2012 Ard Biesheuvel <ard.biesheuvel@gmail.com> ARM: make CRT_LEGACY_WORKAROUND work as intended

To properly support legacy ARM shared libraries, libc.so needs
to export the symbols __dso_handle and atexit, even though
these are now supplied by the crt startup code.

This patch reshuffles the existing CRT_LEGACY_WORKAROUND
conditionally compiled code slightly so it works as the
original author likely intended.

Change-Id: Id6c0e94dc65b7928324a5f0bad7eba6eb2f464b9
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
561bf16be54de9a1387a2063a5609f925ccfb898 22-Aug-2012 Brian Carlstrom <bdc@google.com> Revert "Upgrade to dlmalloc 2.8.5."

This reverts commit 999089181ef60bb67e1a49f2cf6f4ec608a7caf8.
f72ee269274170cd46af2844a2fe88767fb6e43c 22-Aug-2012 Brian Carlstrom <bdc@google.com> Revert "Upgrade to dlmalloc 2.8.5."

This reverts commit 999089181ef60bb67e1a49f2cf6f4ec608a7caf8.
404e28ff8c3352a4fa290ae7769922db0172008e 22-Aug-2012 Ard Biesheuvel <ard.biesheuvel@gmail.com> hardening: remove pointless ARM __get_pc() function

Useful if you're trying to defeat ASLR, otherwise not
so much ...

Change-Id: I17ebb50bb490a3967db9c3038f049adafe2b8ea7
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
999089181ef60bb67e1a49f2cf6f4ec608a7caf8 18-Aug-2012 Ian Rogers <irogers@google.com> Upgrade to dlmalloc 2.8.5.

Move dlmalloc code to upstream-dlmalloc to make pulling upstream changes
easier.
Declare pvalloc and malloc_usable_size routines present in malloc.h but with
missing implementations. Remove other functions from malloc.h that have
no implementation nor use in Android.

Change-Id: Ia6472ec6cbebc9ad1ef99f4669de9d33fcc2efb4
04a83a48ed89f433c78e31106ed50059764797a0 17-Aug-2012 Elliott Hughes <enh@google.com> Enhance getcwd(3) to handle NULL like glibc.

Bug: http://code.google.com/p/android/issues/detail?id=36085
Change-Id: I960a1b585887eb66176c61d29c5c61c239a4003f
22d366cc09383956dc264ed4641572e609392eee 08-Aug-2012 Jin Wei <wei.a.jin@intel.com> enable clone system call for x86

Add __bionic_clone function for x86, which will be
used for clone system call.

Change-Id: I889dc9bf4b7ebb4358476e17e6f3233e26491f4d
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 51414
cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8 15-Aug-2012 Elliott Hughes <enh@google.com> Switch to the current NetBSD regex implementation.

Change-Id: If32b28dd85d6a7ab8957ab81d19fa4c0de9499d5
409302f0f9fce73ea4c82bbfd439041cd7923d34 14-Aug-2012 Elliott Hughes <enh@google.com> Switch to upstream NetBSD tdelete/tfind/tsearch.

tdestroy is a GNU extension, so that stays.

Change-Id: Iedebaff25ea7e92b1ab1dd4440da12b67b99aa40
3d2d448af1b16923f5a329b49bb8e658dbad8a06 14-Aug-2012 Elliott Hughes <enh@google.com> Fix nice...

...by switching to the NetBSD implementation.

Change-Id: I562b27b237a24ded95804035cc322c7bff12ff59
de727caee24df86c3052508aa213f7165168913a 14-Aug-2012 Elliott Hughes <enh@google.com> Clean up warnings in stubs.cpp.

Switch to C++ to get extra warnings, and format the code Google style.

Change-Id: Ifc0131bf297a6ee8a8a6b8d049a02518b0b1a4b7
ae5c64413bf72bc18d7fc81e1f5761824bc01f49 13-Aug-2012 Elliott Hughes <enh@google.com> Add dependencies on all the makefiles.

This should help prevent broken builds next time I'm messing with
assembler/compiler/linker flags...

Change-Id: I30f15a3ce3c3f3c60cad7bc59aaba9f42d792224
a4c7933b49f1d43579f184167e79a5fb237bd206 07-Aug-2012 Raghu Gandham <raghu@mips.com> MIPS support to the libc Makefile

Change-Id: Ia1f3f545ca61a5abb235e99046cb3cdaf24d4205
f8b3a920a895a53b207017249080087d562bd0d2 10-Aug-2012 Elliott Hughes <enh@google.com> Revert "Revert "Switch to NetBSD's strxfrm(3).""

This reverts commit 8793e7c7d21a0434d1b5e63364c88b2b125a3d29,
and fixes the build by building upstream NetBSD source as a
separate library that's then swallowed whole into libc_common.

Change-Id: I6c9317d8c48b5ccaf85a7b185bc07fb31176ff97
8793e7c7d21a0434d1b5e63364c88b2b125a3d29 10-Aug-2012 Elliott Hughes <enh@google.com> Revert "Switch to NetBSD's strxfrm(3)."

This reverts commit be1d78b0dc899a732c0e9d7515d3023e8004e368

Change-Id: I11a95db474796f3da004f27652b081d5ba4ec9b4
be1d78b0dc899a732c0e9d7515d3023e8004e368 10-Aug-2012 Elliott Hughes <enh@google.com> Switch to NetBSD's strxfrm(3).

There were two bugs in our implementation. Intel found one, but another
remainined, and tracking upstream is the way forward for functions where
we add no value.

Change-Id: Ida9bac0293fb2c4cbc942b1e0515ee0477c6538b
76be660aae0911467c51dc3f86a4f8d7fed5b332 08-Aug-2012 Elliott Hughes <enh@google.com> Clean up libc/Android.mk a bit after the crtbrand changes.

Change-Id: Icfb95fffe70967418cd93da8cbeae22dcd68f8c9
405b8029a6888f386adf3512113a33546141d1c8 26-Jul-2012 Raghu Gandham <raghu@mips.com> MIPS support for libc.

Change-Id: I2864dea04b3faf2d919165dcaa600af5b16c41c8
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
ea8fad11d980d55ebd2bcf2302f3f1f742b6351c 31-Jul-2012 Michael Hope <michael.hope@linaro.org> Add a .note.android.ident section to Android ELF binaries.

This allows debugging tools to know they are working with Android
binaries and adapt accordingly.

Signed-off-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Signed-off-by: Michael Hope <michael.hope@linaro.org>

Change-Id: Ic906992fcad61c028bb765821637a3e1333bf52b
fc0725ec5cc51053c06bf2c67755a5a57a5da621 28-Jul-2012 Shih-wei Liao <sliao@google.com> Install crt(begin|end)_so.o to target library path.

BUG=6886348.

Change-Id: I176b2c4963d9731b06d10d4e0b92c010a0006b59
260bf8cfe00f83bc579dfe81c78b75bd9973f051 13-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: strlen check.

This test is designed to detect code such as:

int main() {
char buf[10];
memcpy(buf, "1234567890", sizeof(buf));
size_t len = strlen(buf); // segfault here with _FORTIFY_SOURCE
printf("%d\n", len);
return 0;
}

or anytime strlen reads beyond an object boundary. This should
help address memory leakage vulnerabilities and make other
unrelated vulnerabilities harder to exploit.

Change-Id: I354b425be7bef4713c85f6bab0e9738445e00182
6334c662cae4cd9b61f5f3185048b0cd3633dad7 10-Jul-2012 Nick Kralevich <nnk@google.com> Don't use -fstack-protector on ssp.c

libc's stack protector initialization routine (__guard_setup)
is in bionic/ssp.c. This code deliberately modifies the stack
canary. This code should never be compiled with -fstack-protector-all
otherwise it will crash (mismatched canary value).

Force bionic/ssp.c to be compiled with -fno-stack-protector

Change-Id: Ib95a5736e4bafe1a460d6b4e522ca660b417d8d6
965dbc6405aa2c3170270cfc53a8d4416444fddb 03-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add fgets support.

Change-Id: I8c3410a90c71a3336c4ac8581618fa9330edf5e3
8df49ad2467ec2d48f94a925162185c34bf6e68b 14-Jun-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add strlcpy / strlcat support

Add strlcpy / strlcat support to FORTIFY_SOURCE. This allows
us to do consistency checks on to ensure we don't overflow buffers
when the compiler is able to tell us the size of the buffer we're
dealing with.

Unlike previous changes, this change DOES NOT use the compiler's
builtin support. Instead, we do everything the compiler would
normally do.

Change-Id: I47c099a911382452eafd711f8e9bfe7c2d0a0d22
9b549c39c938f54680f282c21e6885f53254bfb0 13-Jun-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add sprintf / vsprintf support

sprintf FORTIFY_SOURCE protections are not available
on clang.

Also add various __attribute__s to stdio functions.

Change-Id: I936d1f9e55fe53a68885c4524b7b59e68fed218d
cffdf6693ffb50d2a1258d955a162bca83038f25 12-Jun-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add snprintf, vsnprintf

Add _FORTIFY_SOURCE support for snprintf, vsnprintf

At this time, we opt out of these protections for clang, as clang
does not implement __builtin_va_arg_pack().

http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc

Change-Id: I73ebe5ec8dad1dca8898a76d6afb693a25f75375
76656afc6dd069fcfda5768e6e54bb85e4e99942 08-Jun-2012 Nick Kralevich <nnk@google.com> _FORTIFY_SOURCE: check for integer overflows

Ensure that strcat / strncat check for integer overflows
when computing the length of the resulting string.

Change-Id: Ib806ad33a0d3b50876f384bc17787a28f0dddc37
71a18dd435e96564539b5af71b8ea5093a2109a1 07-Jun-2012 Nick Kralevich <nnk@google.com> _FORTIFY_SOURCE: add memset / bzero support

Add _FORTIFY_SOURCE support for the following functions:

* memset
* bzero

Move the __BIONIC_FORTIFY_INLINE definition to cdefs.h so it
can be used from multiple header files.

Change-Id: Iead4d5e35de6ec97786d58ee12573f9b11135bb7
470631ed79538ce912edb94505dee3e24af8db89 06-Jun-2012 Elliott Hughes <enh@google.com> Give the timer_create SIGEV_THREAD helper threads sensible names.

Bug: 6609676
Change-Id: I286b197c75beee4d9930b0973f2d7dd47c14e91c
0a2301598c207fd1b50015984942fee5e8511593 05-Jun-2012 Nick Kralevich <nnk@google.com> libc: implement some FORTIFY_SOURCE functions

Add initial support for -D_FORTIFY_SOURCE to bionic for the
following functions:

* memcpy
* memmove
* strcpy
* strcat
* strncpy
* strncat

This change adds a new version of the above functions which passes
the size of the destination buffer to __builtin___*_chk.

If the compiler can determine, at compile time, that the destination
buffer is large enough, or the destination buffer can point to an object
of unknown size, then the check call is bypassed.

If the compiler can't make a compile time decision, then it calls
the __*_chk() function, which does a runtime buffer size check

These options are only enabled if the code is compiled with
-D_FORTIFY_SOURCE=1 or 2, and only when optimizations are enabled.

Please see
* http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
* http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html

for additional details on FORTIFY_SOURCE.

Testing: Compiled the entire Android tree with -D_FORTIFY_SOURCE=1,
and verified that everything appears to be working properly.
Also created a test buffer overflow, and verified that it was
caught by this change.

Change-Id: I4fddb445bafe92b16845b22458d72e6dedd24fbc
e1dd3c287ba836281de0197670018bd9bbfbd62b 29-May-2012 Iliyan Malchev <malchev@google.com> bionic: import heaptracker as chk_malloc

This patch is a rewrite of libc.debug.malloc = 10 (chk_malloc). It provides
the same features as the original (poison freed memory, detect heap overruns
and underruns), except that it provides more debugging information whenever it
detects a problem.

In addition to the original features, the new chk_malloc() implementation
detects multiple frees within a given range of the last N allocations, N being
configurable via the system property libc.debug.malloc.backlog.

Finally, this patch keeps track of all outstanding memory allocations. On
program exit, we walk that list and report each outstanding allocation.

(There is support (not enabled) for a scanner thread periodically walks over
the list of outstanding allocations as well as the backlog of recently-freed
allocations, checking for heap-usage errors.)

Feature overview:

1) memory leaks
2) multiple frees
3) use after free
4) overrun

Implementation:

-- for each allocation, there is a:
1) stack trace at the time the allocation is made
2) if the memory is freed, there is also a stack trace at the point
3) a front and rear guard (fence)
4) the stack traces are kept together with the allocation

-- the following lists and maintained

1) all outstanding memory allocations
3) a backlog of allocations what are freed; when you call free(), instead of
actually freed, the allocation is moved to this backlog;
4) when the backlog of allocations gets full, the oldest entry gets evicted
from it; at that point, the allocation is checked for overruns or
use-after-free errors, and then actually freed.
5) when the program exits, the list of outstanding allocations and the
backlog are inspected for errors, then freed;

To use this, set the following system properties before running the process or
processes you want to inspect:

libc.malloc.debug.backlog # defaults to 100
libc.malloc.debug 10

When a problem is detected, you will see the following on logcat for a multiple
free:

E/libc ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 BYTES MULTIPLY FREED!
E/libc ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 ALLOCATED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc 0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc 0000c658 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc 00016d80 /system/lib/libc.so
E/libc ( 7233): #03 pc 4009647c /system/bin/malloctest
E/libc ( 7233): #04 pc 00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 FIRST FREED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc 0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc 0000c7d2 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc 00016d94 /system/lib/libc.so
E/libc ( 7233): #03 pc 40096490 /system/bin/malloctest
E/libc ( 7233): #04 pc 00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 NOW BEING FREED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc 0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc 0000c6ac /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc 00016d94 /system/lib/libc.so
E/libc ( 7233): #03 pc 400964a0 /system/bin/malloctest
E/libc ( 7233): #04 pc 00016f24 /system/lib/libc.so

The following for a heap overrun and underrun:

E/libc ( 7233): +++ REAR GUARD MISMATCH [10, 11)
E/libc ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 HAS A CORRUPTED REAR GUARD
E/libc ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 ALLOCATED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc 0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc 0000c658 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc 00016d80 /system/lib/libc.so
E/libc ( 7233): #03 pc 40096438 /system/bin/malloctest
E/libc ( 7233): #04 pc 00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 FREED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc 0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc 0000c7d2 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc 00016d94 /system/lib/libc.so
E/libc ( 7233): #03 pc 40096462 /system/bin/malloctest
E/libc ( 7233): #04 pc 00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 HAS A CORRUPTED FRONT GUARD
E/libc ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 ALLOCATED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc 0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc 0000c658 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc 00016d80 /system/lib/libc.so
E/libc ( 7233): #03 pc 400964ba /system/bin/malloctest
E/libc ( 7233): #04 pc 00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 FREED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc 0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc 0000c7d2 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc 00016d94 /system/lib/libc.so
E/libc ( 7233): #03 pc 400964e4 /system/bin/malloctest
E/libc ( 7233): #04 pc 00016f24 /system/lib/libc.so

The following for a memory leak:

E/libc ( 7233): +++ THERE ARE 1 LEAKED ALLOCATIONS
E/libc ( 7233): +++ DELETING 4096 BYTES OF LEAKED MEMORY AT 0x404b95e8 (1 REMAINING)
E/libc ( 7233): +++ ALLOCATION 0x404b95e8 SIZE 4096 ALLOCATED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc 0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc 0000c658 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc 00016d80 /system/lib/libc.so
E/libc ( 7233): #03 pc 0001bc94 /system/lib/libc.so
E/libc ( 7233): #04 pc 0001edf6 /system/lib/libc.so
E/libc ( 7233): #05 pc 0001b80a /system/lib/libc.so
E/libc ( 7233): #06 pc 0001c086 /system/lib/libc.so
E/libc ( 7233): #07 pc 40096402 /system/bin/malloctest
E/libc ( 7233): #08 pc 00016f24 /system/lib/libc.so

Change-Id: Ic440e9d05a01e2ea86b25e8998714e88bc2d16e0
Signed-off-by: Iliyan Malchev <malchev@google.com>
9d40326830c2bd407427889c554adeb915ee6b4a 31-May-2012 Nick Kralevich <nnk@google.com> arm: rewrite crtbegin* as C files.

Rewrite
crtbegin.S -> crtbegin.c
crtbegin_so.S -> crtbegin_so.c

This change allows us to generate PIC code without relying
on text relocations.

As a consequence of this rewrite, also rewrite
__dso_handle.S -> __dso_handle.c
__dso_handle_so.S -> __dso_handle_so.c
atexit.S -> atexit.c

In crtbegin.c _start, place the __PREINIT_ARRAY__, __INIT_ARRAY__,
__FINI_ARRAY__, and __CTOR_LIST__ variables onto the stack, instead of
passing a pointer to the text section of the binary.

This change appears sorta wonky, as I attempted to preserve,
as much as possible, the structure of the original assembly.
As a result, you have C files including other C files, and other
programming uglyness.

Result: This change reduces the number of files with text-relocations
from 315 to 19 on my Android build.

Before:
$ scanelf -aR $OUT/system | grep TEXTREL | wc -l
315

After:
$ scanelf -aR $OUT/system | grep TEXTREL | wc -l
19

Change-Id: Ib9f98107c0eeabcb606e1ddc7ed7fc4eba01c9c4
83a73d1afe972014f6c8ff2520fe6d3357421f87 30-May-2012 Nick Kralevich <nnk@google.com> crtbegin: eliminate duplicate code

crtbegin_dynamic and crtbegin_static are essentially identical,
minus a few trivial differences (comments and whitespace).

Eliminate duplicates.

Change-Id: Ic9fae6bc9695004974493b53bfc07cd3bb904480
fc9e525fe07846c1efa23235a59575f8dad69c53 16-May-2012 Ying Wang <wangying@google.com> Rename the misleading var name TARGET_OUT_STATIC_LIBRARIES

TARGET_OUT_STATIC_LIBRARIES is actually the same as
TARGET_OUT_INTERMEDIATE_LIBRARIES.

Change-Id: I11ac35256031d461d20156cd4c19ed7eae781d22
08e72d0161e39e99ff1003bf1ce894f37d7b7eb4 07-May-2012 Prajakta Gudadhe <pgudadhe@nvidia.com> bionic: add support for non-NEON memcpy() on NEON SoCs

Some SoCs that support NEON nevertheless perform better with a non-NEON than a
NEON memcpy(). This patch adds build variable ARCH_ARM_USE_NON_NEON_MEMCPY,
which can be set in BoardConfig.mk. When ARCH_ARM_USE_NON_NEON_MEMCPY is
defined, we compile in the non-NEON optimized memcpy() even if the SoC supports
NEON.

Change-Id: Ia0e5bee6bad5880ffc5ff8f34a1382d567546cf9
2fd81ef71c10aecf6583facdd79f8f60f3eed678 19-Nov-2011 Jack Ren <jack.ren@intel.com> bionic: allow the board to customize MALLOC_ALIGNMENT

Currently the dlmalloc allocates the memory with 8-byte alignment.
According to the com.aurorasoftworks.quadrant.ui.professional benchmark data:
We can get much better memory performance if we change it to be 16-byte aligned.
For example, On Nexus-S:
8-byte aligned :
1378 1070 1142 1665 1765 1163 1179 1263 1404 avg: 1336.555555556
16-byte aligned:
1691 1731 1780 1691 1671 1678 1802 1758 1780 avg: 1731.333333333
gain: 29.53%

That patch provides flexibity to customize the MALLOC_ALIGNMENT from the
board config.The macro MALLOC_ALIGNMENT defaults to 8.
To change it, please define BOARD_MALLOC_ALIGNMENT in the BoardConfig.mk:
BOARD_MALLOC_ALIGNMENT := <whatever>

Change-Id: I8da0376944a0bbcef1d0fc026bfb6d9125db9739
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
eda7be454d6ff8689392442223335c6558bea932 08-May-2012 Ben Cheng <bccheng@google.com> Implement the "abort" stub in assembly for ARM.

So that we can always get the full stack trace regardless of gcc's handling
of the "noreturn" attribute associated with abort().

(Cherry pick of Id264a5167e7cabbf11515fbc48f5469c527e34d4.)

Bug: 6455193

Conflicts:

libc/Android.mk

Change-Id: I568fc5303fd1d747075ca933355f914122f94dac
08b51e2c091d036c124259ae59eb7be6bbe346af 08-May-2012 Ben Cheng <bccheng@google.com> Implement the "abort" stub in assembly for ARM.

So that we can always get the full stack trace regardless of gcc's handling
of the "noreturn" attribute associated with abort().

[cherry-picked from master]

BUG:6455193
Change-Id: I0102355f5bf20e636d3feab9d1424495f38e39e2
017f438534068f48277fe6f7f7234e6f24ae5065 08-May-2012 Ben Cheng <bccheng@google.com> Implement the "abort" stub in assembly for ARM.

So that we can always get the full stack trace regardless of gcc's handling
of the "noreturn" attribute associated with abort().

BUG:6455193
Change-Id: Id264a5167e7cabbf11515fbc48f5469c527e34d4
a2758f19cee0a8daf3194d8c88eeb4d078000a08 07-May-2012 Nick Kralevich <nnk@google.com> libc: stop using the custom linker script

stop using the custom linker script. It prevents relro from
working on libc.

This reverts commit b091dd9bf27a9132c4ac9da55f2f4a87ffe3b59f.
fe6338da9168330d44b409b2ee36103e8bfe6697 15-Sep-2010 Henrik Smiding <henrik.smiding@stericsson.com> Adjust memcpy for ARM Cortex A9 cache line size

ARM Cortex A8 use 64 bytes and ARM Cortex A9 use 32 bytes cache line
size.

The following patch:
Adds code to adjust memcpy cache line size to match A9 cache line
size.
Adds a flag to select between 32 bytes and 64 bytes cache line
size.

Copyright (C) ST-Ericsson SA 2010
Modified neon implementation to fit Cortex A9 cache line size
Author: Henrik Smiding henrik.smiding@stericsson.com for
ST-Ericsson.

Change-Id: I8a55946bfb074e6ec0a14805ed65f73fcd0984a3
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
b091dd9bf27a9132c4ac9da55f2f4a87ffe3b59f 26-Apr-2012 Nick Kralevich <nnk@google.com> libc: continue to use Android's custom linker script

By default, Android no longer compiles code using it's custom
linker script /build/core/armelf.xsc. However, this causes
problems for libc. Certain programs linked using older versions
of GOLD expect libc.so to export __exidx_start and __exidx_end.
Removing the custom linker script causes libc.so not to export
those symbols.

For now, continue using the old linker script, until we can
figure out a better solution.

Change-Id: Iaf002afd63a58b848818da24e5a4525620dc4d74
03273f8fc0a7ac2b54fa2c983d4a647580e34458 11-Apr-2012 Kenny Root <kroot@google.com> __on_dlclose should be aligned

Marking segments read-only was pushing the alignment of __on_dlclose by
2 bytes making it unaligned. This change makes sure the ARM code is
aligned to the 4 byte boundary.

Bug: 6313309
Change-Id: Ic2bf475e120dd61225ec19e5d8a9a8b1d0b7f081
21eab513e7eec280a7a8bcb9482a1a8b61e59442 14-Mar-2012 Ben Cheng <bccheng@google.com> New additions/bug fixes required/found when porting perf.

New functions:
tfind
tsearch
tdelete
twalk
tdestroy (GNU extension)

Bug fix: the current implementation for realpath would crash
if the second argument (resolved_path) is NULL.

New headers:
ar.h
search.h

Change-Id: Ib6c1e42fc186a6d597a6e5a9692b16acaa155804
70b1668a76d3b719ae690903ea790fda964a5458 30-Jan-2012 David 'Digit' Turner <digit@google.com> remove obsolete SuperH support

We don't have a toolchain anymore, we don't have working original
kernel headers, and nobody is maintaining this so there is really
no point in keeping this here. Details of the patch:

- removed code paths from Android.mk files related to the SuperH
architecture ("sh")

- removed libc/arch-sh, linker/arch-sh, libc/kernel/arch-sh

- simplified libc/SYSCALLS.TXT

- simplified the scripts in libc/tools/ and libc/kernel/tools

Change-Id: I26b0e1422bdc347489e4573e2fbec0e402f75560

Signed-off-by: David 'Digit' Turner <digit@android.com>
a5cb76bca00b1ce44a04687fb179809c12ea9cd3 14-Dec-2011 David 'Digit' Turner <digit@google.com> libc: x86: Use SSE2 or SSSE3 optimized routines when possible.

This patch uses the new hardware feature macros for x86 to define
various compile-time macros used to make the C library use
SSE2 and/or SSSE3 optimized memory functions for target CPUs
that support these features.

Note that previously, we relied on the macros being defined by
build/core/combo/TARGET_linux-x86.mk, but this is no longer the
case.

Change-Id: Ieae5ff5284c0c839bc920953fb6b91d2f2633afc
7c0c3793722aea293c45921ef50e4adcdf9645ce 06-Sep-2011 Mathias Agopian <mathias.agopian@gmail.com> implement pthread mutex deadlock detection

this works by building a directed graph of acquired
pthread mutexes and making sure there are no loops in
that graph.

this feature is enabled with:

setprop debug.libc.pthread 1

when a potential deadlock is detected, a large warning is
output to the log with appropriate back traces.

currently disabled at compile-time. set PTHREAD_DEBUG_ENABLED=1
to enable.

Change-Id: I916eed2319599e8aaf8f229d3f18a8ddbec3aa8a
af96d4dadc3f3d8466dbbeaf3a816e6871715fbc 09-Dec-2011 Bruce Beare <bruce.j.beare@intel.com> x86: libc may use the gcc flags from TARGET_linux-x86.mk

Change-Id: Iaf4d864d4b6fe388bd3c2d7c4d7d6e42aebb0d35
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
10c8ce59a40a1d8ae8f49145eca365b364aabe58 19-Nov-2011 Jeff Brown <jeffbrown@google.com> Add tgkill syscall.

Use tgkill instead of tkill to implement pthread_kill.
This is safer in the event that the thread has already terminated
and its id has been reused by a different process.

Change-Id: Ied715e11d7eadeceead79f33db5e2b5722954ac9
0fec6b9d88ee5a9e359b2208038f9806c0804538 16-Nov-2011 David 'Digit' Turner <digit@google.com> libc: provide atomic operations will full barriers for NDK apps.

__atomic_cmpxchg and other related atomic operations did not
provide memory barriers, which can be a problem for non-platform
code that links against them when it runs on multi-core devices.

This patch does two things to fix this:

- It modifies the existing implementation of the functions
that are exported by the C library to always provide
full memory barriers. We need to keep them exported by
the C library to prevent breaking existing application
machine code.

- It also modifies <sys/atomics.h> to only export
always-inlined versions of the functions, to ensure that
any application code compiled against the new header will
not rely on the platform version of the functions.

This ensure that said machine code will run properly on
all multi-core devices.

This is based on the GCC built-in sync primitives.

The end result should be only slightly slower than the
previous implementation.

Note that the platform code does not use these functions
at all. A previous patch completely removed their usage in
the pthread and libstdc++ code.

+ rename arch-arm/bionic/atomics_arm.S to futex_arm.S
+ rename arch-x86/bionic/atomics_x86.S to futex_x86.S
+ remove arch-x86/include/sys/atomics.h which already
provided inlined functions to the x86 platform.

Change-Id: I752a594475090cf37fa926bb38209c2175dda539
afb0167ad915f3f43c3194ed787199187f1bb56f 20-Jun-2011 Bruce Beare <bruce.j.beare@intel.com> Enable functional DSO object destruction

Unfortunately, legacy .so files for ARM don't have a correct crtbegin file.
Consequently, we have to grandfather the old __dso_handle behaviour.
Add some ifdefs for ARM to allow it to use the old code until we can work
out a transition.

Change-Id: I6a28f368267d792c94e1d985d8344023bc632f6f
Author: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
a0aec0bd3083280dcba0c3aaba39602425228e2a 04-May-2011 Bruce Beare <bruce.j.beare@intel.com> x86: Enable -fstack-protector

Change-Id: Iff9e3a3ba0e2d0faa7c6d98154aa5be0cc8a6c50
Orig-Change-Id: Ib69514c3afcb4c1f5e5f3f8cd91acfd145a0866c
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
832a86eaba56dcf8066e4b96df12738a9dff7053 31-May-2011 Bruce Beare <bruce.j.beare@intel.com> Update ATOM string routines to latest

Orig-Change-Id: I22a600e7f172681cfd38ff73a64e3fd07b284959
Signed-off-by: Lu, Hongjiu <hongjiu.lu@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
88bb394c0d2cb96a85acb43e25cacfe8235ac1af 08-Jul-2010 Bruce Beare <brucex.j.beare@intel.com> Fix undefined reference to dl_iterate_phdr for x86

Orig-Change-Id: I22410b27939e8f54da932d7a1104102550c4685f
Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
c51871d4b22425b32ec40c060c39d6b6fa4406f6 06-Jul-2011 David 'Digit' Turner <digit@android.com> Really fix the build.

libcutils/mspace.c includes libc/bionic/dlmalloc.c, we need to
take care of the fact that any internal C library function cannot
be used from it.

Change-Id: I0bc81ae090b7ac2d464f26b97fc6b94a08cdad9c
2d2dbd30243f4ffd1e0a10ade989e25d29f7f45c 25-Jun-2011 David 'Digit' Turner <digit@google.com> x86: fix full_x86-eng build

The latest merge conflict resolution worked only for ARM, but not for x86
Both ARM and x86 builds have been tested with this fix.

Change-Id: I4ec1f1b0ea32fa86e7e2515b221133473d6550a3
NOTE: Care has been taken to not change the compiler flags for ARM builds.
In particular, when building crtbegin_so.so, the -fPIC flag is only
used for x86 (previous reports indicate that it breaks the ARM
build at runtime for obscure reasons).
39640842823ba4cd42bd11514c0da39aa939519f 20-Jun-2011 Bruce Beare <bruce.j.beare@intel.com> Enable functional DSO object destruction

Unfortunately, legacy .so files for ARM don't have a correct crtbegin file.
Consequently, we have to grandfather the old __dso_handle behaviour.
Add some ifdefs for ARM to allow it to use the old code until we can work
out a transition.

Change-Id: I6a28f368267d792c94e1d985d8344023bc632f6f
Author: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
a903811819c06e4d6e9e27fcc9db3ab5459009bc 07-Jun-2011 Martijn Coenen <maco@google.com> Revert "x86: Enable -fstack-protector"

This reverts commit e0b4844a20ffd022a568abb4203b3f7c759c7ff5,
causes netd to crash.
e0b4844a20ffd022a568abb4203b3f7c759c7ff5 04-May-2011 Bruce Beare <bruce.j.beare@intel.com> x86: Enable -fstack-protector

Change-Id: Ib69514c3afcb4c1f5e5f3f8cd91acfd145a0866c
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
f50e9be5930a08fa825b0c23353c802e11369b14 20-Apr-2011 Jim Huang <jim.huang@linaro.org> bionic: Add ARM optimized strcmp()

Reference results of the experiments on TI OMAP3430 at 600 MHz

$ bench_strcmp -N "strcmp_1k" -s 1k -I 200

[original C code]
prc thr usecs/call samples errors cnt/samp size
strcmp_1k 1 1 10.38000 102 0 15000 1024

[ARM optimized code]
prc thr usecs/call samples errors cnt/samp size
strcmp_1k 1 1 3.08840 88 0 15000 1024

The work was derived from ARM Ltd, contributed to newlib, and reworked
for Android by Linaro.

Change-Id: Ib0d5755e1eb9adb07d80ef0252f57a5c4c57a425
Signed-off-by: Jim Huang <jserv@0xlab.org>
368070454b1349d1fcf29a5d1eb51c869fb538f6 14-Mar-2011 Iliyan Malchev <malchev@google.com> bionic: remove LOCAL_PRELINK_MODULE

Change-Id: Iad65ae18446b20d2aace7b8fe19b1a032b616e9c
Signed-off-by: Iliyan Malchev <malchev@google.com>
81a844a0fc3c6850afc6cf8580e0d9c10267a879 04-Feb-2011 Andy McFadden <fadden@android.com> Added _memmove_words

Added a memmove() variant for Dalvik's System.arraycopy()
implementation. It guarantees 16-bit or 32-bit atomicity depending
on the alignment of the arguments.

Bug 3398352

(cherry-pick from master)

Change-Id: I5e64de1c76971ba234bf2dd05477ba390e0412a4
4ce737f5df6bda362b45ca2a9d72d0aad2d5a58f 04-Feb-2011 Andy McFadden <fadden@android.com> Added _memmove_words

Added a memmove() variant for Dalvik's System.arraycopy()
implementation. It guarantees 16-bit or 32-bit atomicity depending
on the alignment of the arguments.

Bug 3398352

Change-Id: Ie7bd246305ef0ff8290513663327c5b81680368d
18635d9c173120f6f97dd9b035b6f9a1ebfcd1a3 14-Dec-2010 Chih-Wei Huang <cwhuang@linux.org.tw> android-x86: add sigsetjmp.S

It adds two functions sigsetjmp and siglongjmp
that fix compiling errors in bluetooth and mksh.

Copy directly from sigsetjmp.S of OpenBSD.

Change-Id: I4696f82ee6f85d1c93cbdd3c9e40f4917d50f3a6
95d751feacdb58d3fbc36f3f21a895a3ec2f065b 16-Dec-2010 David 'Digit' Turner <digit@google.com> libc: Add ftruncate64 and improve 64-bit parameter syscall handling.

This patch improves the handling of 64-bit parameters in syscalls on ARM.
The ARM EABI mandates that 64-bit quantities be passed in even/odd register
pairs, which requires special treatment.

This allows us to simplify our implementations of pread() and pwrite()
and remove the C stubs for pread64() and pwrite64().

Also add ftruncate64() to <unistd.h>

Change-Id: I407e2fd223ba0093dd2d0b04c6152fadfc9ce3ef

Bug 3107933
72e6fd42421dca80fb2776a9185c186d4a04e5f7 03-Dec-2010 David 'Digit' Turner <digit@google.com> <sched.h>: Add sched_getcpu() and cpu_set_t

This adds the cpu_set_t type definition and related functions
and macros used to handle CPU thread affinity.

sched_getcpu()
sched_setaffinity()
sched_getaffinity()

Change-Id: If382ecafde8926341a88478062b275553645065b
72e64e08697cc2b3d66397c8b6d34965dd2a7338 24-Nov-2010 Kenny Root <kroot@google.com> Add support for pread64/pwrite64

64-bit pread() and pwrite() is needed for ZipFileRO to be able to read
ludicrously large ZIP files just in case someone is crazy enough to do
it.

Also fix a license header that was apparently mangled.

Change-Id: I6819ef8b36e46b63b40749c95717b1ecf9307033
73c04b32691cb344cb60289a646ded8fc551d09e 10-Aug-2010 Jim Huang <jserv@0xlab.org> bionic: Add ARM optimized strcpy()

Reference results of the experiments on Qualcomm MSM7x25 (524MHz):

[original C code]
prc thr usecs/call samples errors cnt/samp
size
strcpy_1k 1 1 14.56159 99 0 1000
1024

[ARM optimized code]
prc thr usecs/call samples errors cnt/samp
size
strcpy_1k 1 1 3.46653 99 0 1000
1024

The work was derived from ARM Ltd.

Change-Id: I906ac53bb7a7285e14693c77d3ce8d4ed6f98bfd
70478100d5967f528e6514a42f98a76bb85b7e28 27-Sep-2010 Jim Huang <jserv@0xlab.org> Remove duplicated _rand48 implementation. Use stdlib version instead

Originally, there are _rand48 (in libc/bionic/_rand48.c) and __rand48
(in libc/stdlib/_rand48.c) implemented in bionic. Besides the naming,
the functionality is identical. This patch removes the duplicated
_rand48. Also, drand48 and erand48 are modified accordingly.

Change-Id: Ie5761a0a97f45df8538222a77edacb7c3e0125d7
124a542aa4d78040176f65b28f4958540b5d89aa 11-Oct-2010 Bruce Beare <brucex.j.beare@intel.com> Update ATOM string routines to latest

Change-Id: I22a600e7f172681cfd38ff73a64e3fd07b284959
Signed-off-by: Lu, Hongjiu <hongjiu.lu@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
defd162212de3789d2268a1f3339c2a6097fa825 26-Sep-2010 David 'Digit' Turner <digit@google.com> libc: add <sys/eventfd.h> and corresponding implementations.

Change-Id: Ide040884c456190226e580513099fdb8377e015b
cb99ab98c99291a6c90043009ab8d64ec8058f9d 10-Sep-2010 Kenny Root <kroot@google.com> Add wmemcmp to Android.mk

Change-Id: I9dc96d72b2becdd31981b4d176a13358aef6dcb9
6a51defa034a1c033ed01f7de444c0a4fc615249 27-Aug-2010 David 'Digit' Turner <digit@google.com> Fix __get_tls() in static C library to use kernel helpers.

This is needed to fix gdbserver's handling of threaded programs,
among other things.

Change-Id: I823387c602cef9891532da946a01db14be780ab0
41e533af4a2720c1dc228ba40b6582ca53085c3a 09-Jun-2010 Szymon Jakubczak <szym@google.com> added missing ether_aton and ether_ntoa

Change-Id: I32ee448abde4d5693d393030ed77ddc6d2ad1dfc
3871d57ba581236142c9bf2f8be2d34cce7c5829 18-Aug-2010 Jean-Baptiste Queru <jbq@google.com> Revert "added missing ether_aton and ether_ntoa"

This reverts commit 4032c1e2dfcc99613fe3e509a8153191e35aec12.
18c5bcc66a9a7b2178dcdcf04a0716958798ab81 30-Jul-2010 Dima Zavin <dima@android.com> Revert "Set SA_RESTORER in sigaction()"

This reverts commit e4fa46e75cd0d433b5c6c064720ed7e195cba7c8.
26c15a8eb9a445527d679935b86960211bbb85a8 26-Jul-2010 Chih-Wei Huang <cwhuang@linux.org.tw> Move the atom optimization flags into TARGET_linux-x86.mk.

Setting libc_crt_target_cflags to be non-recursive is necessary.

Change-Id: I5310d86e705f23da126c21ecb33a97a074da584a
4f086aeb4aa06e13079b7fec71a8178ceeacf318 25-Jun-2010 Matt Fischer <matt.fischer@garmin.com> Implemented pthread_atfork()

Change-Id: Ie6c0bf593315d3507b3c4a6c8903a74a1fa053db
ab8b54101eed0a4b92ebf8fa6994cd1b4f22d8f4 09-Jul-2010 David 'Digit' Turner <digit@google.com> libc: fix fstatfs() implementation.

The syscall expects the size of the buffer as the second argument.

Change-Id: I99ede2fec7fcd385ca03ff022c2cffa4297bea8d
aa46fa24035f3ab020f9a7abd86c25ae2196bb32 08-Jul-2010 Bruce Beare <brucex.j.beare@intel.com> Fix undefined reference to dl_iterate_phdr for x86

Change-Id: I22410b27939e8f54da932d7a1104102550c4685f
Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
3b43f87d2949a340e2c19cb735af7727157d8274 02-Jul-2010 David 'Digit' Turner <digit@android.com> Allow dlclose() to properly call static C++ destructors.

With this patch _and_ an upcoming build/ patch, the destruction
of static C++ objects contained in shared libraries will happen
properly when dlclose() is called.

Note that this change introduces crtbegin_so.S and crtend_so.S which
are currently ignored by the build system.

+ move definition of __dso_handle to the right place
(before that, all shared libraries used the __dso_handle
global variable from the C library).

Note that we keep a 'weak' __dso_handle in aeabi.c to avoid
breaking the build until the next patch to build/core/combo/
appears. We will be able to remove that later.

+ move bionic/aeabi.c to arch-arm/bionic/ (its proper location)

NOTE: The NDK will need to be modified to enable this feature in
the shared libraries that are generated through it.

Change-Id: I99cd801375bbaef0581175893d1aa0943211b9bc
50ace4fec5e8cb5afcbc656a4556fa528adfd760 17-Jun-2010 David 'Digit' Turner <digit@google.com> Remove compiler warnings when building Bionic.

Also add missing declarations to misc. functions.
Fix clearerr() implementation (previous was broken).
Handle feature test macros like _POSIX_C_SOURCE properly.

Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
6a9b888d7c4b246f6f66360789c72b754ff85021 18-Jun-2010 David 'Digit' Turner <digit@google.com> Allow static C++ destructors to be properly called on dlclose().

With this patch, _and_ an upcoming build/ patch, the destruction
of static C++ objects contained in shared libraries will happen
properly when dlclose() is called.

Note that this change introduces crtbegin_so.S and crtend_so.S which
are currently ignored by the build system.

+ move definition of __dso_handle to the right place
(before that, all shared libraries used the __dso_handle
global variable from the C library).

Note that we keep a 'weak' __dso_handle in aeabi.c to avoid
breaking the build until the next patch to build/core/combo/
appears. We will be able to remove that later.

+ move bionic/aeabi.c to arch-arm/bionic/ (its proper location)

Change-Id: Ie771aa204e3acbdf02fd30ebd4150373a1398f39
NOTE: The NDK will need to be modified to enable this feature in
the shared libraries that are generated through it.
70465614e14a87f547cdd1b82b0b270b87d215c1 16-Jun-2010 Kristian Monsen <kristianm@google.com> Just link fixes for b 2763938.

Added wcsxfrm.c and wmemcmp.c to the src files in Android.mk and removed wcsxfrm from wchar.c

Change-Id: Iab9b45cf78c27880d2941c360340a7af6b8964fe
3527fd6f0df794207215790321824b7844cc712d 15-Jun-2010 David 'Digit' Turner <digit@google.com> wchar.h: improve wchar_t support in Bionic

Change-Id: Iffd41046fd0933c66542abf7627a1569522dfcb2
4032c1e2dfcc99613fe3e509a8153191e35aec12 09-Jun-2010 Szymon Jakubczak <szym@google.com> added missing ether_aton and ether_ntoa

Change-Id: I32ee448abde4d5693d393030ed77ddc6d2ad1dfc
7c99c1856fce65c0394cd578c2a8ed37da2f288d 28-May-2010 Andy McFadden <fadden@android.com> Atomic/SMP update, part 3. (manual merge)

Update ARM atomic ops to use LDREX/STREX. Stripped out #if 0 chunk.

Insert explicit memory barriers in pthread and semaphore code.

For bug 2721865.

Change-Id: I595cc8e5a8d1e4906b6641115e46208a7e9e755a
fcd00ebbdf3e7f4e1e7782a65ae10fb0fc03a1aa 28-May-2010 Andy McFadden <fadden@android.com> Atomic/SMP update, part 3.

Update ARM atomic ops to use LDREX/STREX. Stripped out #if 0 chunk.

Insert explicit memory barriers in pthread and semaphore code.

For bug 2721865.

Change-Id: I0f153b797753a655702d8be41679273d1d5d6ae7
8a1d2cf1422e35257c160ac5bb12dd3ee481c433 12-May-2010 David 'Digit' Turner <digit@google.com> Add pthread_rwlock_t implementation to the C library (DO NOT MERGE)

Change-Id: I756d8c26afc37cd7b71117ddbaa02a2cb40fdecb
a418c3b8370cae1c80fbe9a06e7e53025da5d6f0 12-May-2010 David 'Digit' Turner <digit@google.com> Add pthread_rwlock_t implementation to the C library

Change-Id: I14d0a112554756a7294a51fe88c1c408a16b5ff1
e4fa46e75cd0d433b5c6c064720ed7e195cba7c8 11-Jan-2010 Matt Fischer <matt.fischer@garmin.com> Set SA_RESTORER in sigaction()

GDB looks for specific opcode sequences when trying to recognize a stack
frame as a signal trampoline. The sequences it looks for happen to be those
created when SA_RESTORER is set, since glibc always sets a restorer. This
patch does the same here, so that the trampolines can be correctly identified.

Change-Id: I0ac574a68818cb24d939c3527f3aaeb04b853d04
8ff1a2759a6389bed30d7862d0beb76077032c99 04-Mar-2010 Bruce Beare <brucex.j.beare@intel.com> Atom optimized string and memory routines

Change-Id: I27b68bb28551c75c9ac84bb9730e2cd8254d8991
d7ed1ae98249af8a58ce97784a29f048d77789a9 05-Mar-2010 David 'Digit' Turner <digit@google.com> Fix timezone management in the C library

Define 'timezone' and 'daylight' global variables that are already
defined in <time.h>

Properly update the 'tm_gmtoff' field in 'struct tm' values.
3c543e1da9a2780a70b25299f39734bf0a18c4a0 04-Mar-2010 Bruce Beare <brucex.j.beare@intel.com> x86 syscall system call implementation
9f6915631b918a56e0e6be958fb14d274cbab322 02-Mar-2010 Mike Chan <mike@android.com> bonic: libc: cpuacct support for setuid functions

Any of the setuid functions now updates /acct/uid/ with its own tid
before changing users. This is so we can properly account for cpu time
per uid.

Change-Id: I34186cf4d5228cac8439e582a9e26c01ef3011e4
Signed-off-by: Mike Chan <mike@android.com>
97cf7f3394780d524038fc083e2c134031b54728 23-Jan-2010 David 'Digit' Turner <digit@google.com> Implement clone() C library function properly.

Only provide an implementation for ARM at the moment, since
it requires specific assembly fragments (the standard syscall
stubs cannot be used because the child returns in a different
stack).
fc10b24accd082fb33c8f92ff8b92481c22fe3dc 14-Jan-2010 Colin Cross <ccross@android.com> Add implementation of fdprintf, clearenv, and stubs for ttyname_r, *usershell

Change-Id: I5fe7e8b6ee5edbb49e707c3b6737a58563781fa3
8c59d96e243ba1a05d7d9ab7a14d1a00e20bad4a 14-Jan-2010 Colin Cross <ccross@android.com> Add killpg function

Change-Id: I9bc347d264fe38faf2d0f9935d2ebb43a353196e
64ceac3f493e3063a289aec4a12c74787be974e4 14-Jan-2010 Colin Cross <ccross@android.com> Add fts, err, and sys/queue for grep

Change-Id: Id47514a1812d828e95efa2fab0e9c15c5b682b58
4fa7b105644222d9b35347c9d226ca8e011072eb 13-Jan-2010 Colin Cross <ccross@android.com> Import regex from OpenBSD

Change-Id: I7ad7d907ef65e4e345f94777d730813b1270a612
5f53a18204ec991f5a77872806eeaa185936aa8c 04-Dec-2009 Mathias Agopian <mathias@google.com> Revert "Add qsort_r() implementation to the C library."

This reverts commit 754c178ae551aedcbbfd3bfd1c1c3b710d9ad989.

Turns out we don't need it afterall (needed a stable sort anyways).
So, we'll make that change in the dev branch instead.
754c178ae551aedcbbfd3bfd1c1c3b710d9ad989 03-Dec-2009 David 'Digit' Turner <digit@google.com> Add qsort_r() implementation to the C library.

NOTE: This replaces qsort.c with the FreeBSD version. While
the patch changes the source, it should not alter the
implementation that should use the exact same algorithm.
b74ceb25aae555570df64fa4d4076272733a9a20 17-Nov-2009 Vladimir Chtchetkine <vchtchetkine@google.com> Split libc_debug.so into two .so modules loaded on demand from libc.so

This change is intended to eliminate need to replace libc.so with libc_debug.so in order to enablememory allocation debugging.
This is also the first step towards implementing extended memoryallocation debugging using emulator's capabilities in monitoring memory access.
194d3fa048cf909ca592dd56fa538dc9cd3f5ddb 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
92b10af793da235659198cf38ff2e0237c181058 02-Oct-2009 Thorsten Glaser <tg@mirbsd.org> Add the BSD sys_signame array.

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
2a7ad97539313c82e13d36c9c75cefb2982a87d8 29-Sep-2009 David 'Digit' Turner <digit@google.com> Fix ABI breakage in libc.so and libm.so between 1.6 and Eclair.

For a detailed description of the problem and why this fix is
needed, plrease read the comments in libgcc_compat.c
10093276e98d26428875480c502a278dffe550c7 28-Sep-2009 Shin-ichiro KAWASAKI <shinichiro.kawasaki.mg@hitachi.com> added and modified bionic code to support SuperH architecture

modified: libc/Android.mk
new files: libc/arch-sh/bionic/*
new files: libc/arch-sh/include/*
4a05d12cf52a9a40759f11f28543bd75715c8f00 18-Sep-2009 David 'Digit' Turner <digit@google.com> Fix TLS access for ARMv6 and beyond.

For performance reasons, we don't call the kernel helper. Instead, we directly
access the TLS register on ARMv6 and higher. For ARMv5TE, keep using the hard-coded
address populated by the kernel on each task switch.

NOTE: Since we don't call the kernel helper, this must precisely match your
kernel configuration. This is controlled by setting the ARCH_ARM_HAVE_TLS_REGISTER
variable to 'true' in your board configuration file.
49e55332784b82f7112ee7c1ea3c176c9dc32d7a 27-May-2009 Dima Zavin <dima@android.com> libc: Add an intermediate version of the static libc without malloc

For now, this will only used by the dynamic loader to ensure that
malloc and friends are never called.

Signed-off-by: Dima Zavin <dima@android.com>
ca122b0e34df0e8c485be0d3ab1b80f728b76276 27-May-2009 Dima Zavin <dima@android.com> libc: Cleanup the libc makefile.

Removes a lot of redundant code, and reorganizes the file. We first
setup all the comomn variables we may need, and then define the
actual libraries that need to be generated.

Signed-off-by: Dima Zavin <dima@android.com>
d2c9dcc9265e66f6432ec39dcc7378b944449e60 24-Apr-2009 Dave Bort <dbort@android.com> libc: Replace a reference to TARGET_BUILD_TYPE with DEBUG_BIONIC_LIBC

We're soon going to stop using TARGET_BUILD_TYPE==debug to debug
native modules.

Signed-off-by: Dave Bort <dbort@android.com>
1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1767f908af327fa388b1c66883760ad851267013 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
9f65adf2ba3bb15feb8b7a7b3eef788df3fd270e 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
6d6c82c7a0a6b9a89f61b61c66f9b90d9c7177dc 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
4e468ed2eb86a2406e14f1eca82072ee501d05fd 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution