Using __builtin_frame_address was clever, but didn't work for arm64 (for
reasons which were never investigated) and the ChromeOS folks claim it
causes trouble for x86 with ARC++ (though without a reproduceable test case).
Naked functions turn out to be quite unevenly supported: some architectures
do the right thing, others don't; some architectures warn, others don't (and
the warnings don't always match the platforms that _actually_ have problems).
Inline assembler also removes the guessing games: everyone knows what the
couple of instructions _ought_ to be, and now we don't have to reason about
what the compiler will actually do (yet still keep the majority of the code
in C).
Bug: N/A
Test: builds, boots
Change-Id: I14207ef50ca46b6eca273c3cb7509c311146a3ca
ETC did end up causing problems, since it's not per-arch. But
SHARED_LIBRARIES isn't correct either, since the build system tries to
read shared libraries as ELF files (to create the toc files).
NATIVE_TESTS is slightly better -- they are not libraries, so we don't
attempt to generate toc files, but they are considered per-arch.
Bug: 38463793
Test: Run CtsBionicTestCases
Change-Id: I01b4b093359e0c39eb2f8639d5c5dde9e304ed20
Some third-party code uses the existence of IN_CLOEXEC/IN_NONBLOCK to
detect the availability of inotify_init1. This is not correct, since
`syscall(__NR_inotify_init1, IN_CLOEXEC)` is still valid even if the C
library doesn't have that function, but for the time being we don't
want to harm adoption to the unified headers. We'll avoid defining
IN_CLOEXEC and IN_NONBLOCK if we don't have inotify_init1 for the time
being, and maybe revisit this later.
Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/394
Change-Id: Iefdc1662b21045de886c7ad1cbeba6241163d943
Some third-party code uses the existence of EPOLL_CLOEXEC to detect
the availability of epoll_create1. This is not correct, since having
up-to-date UAPI headers says nothing about the C library, but for the
time being we don't want to harm adoption to the unified headers.
We'll undef EPOLL_CLOEXEC if we don't have epoll_create1 for the time
being, and maybe revisit this later.
Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/302
Bug: https://github.com/android-ndk/ndk/issues/394
Change-Id: I8ee9ce62768fb174070ec51d114f477389befc4a
We've had pthread_*_setpshared for long enough that there are no
__INTRODUCED_IN guards.
Found because fio's configure script was confused by this.
Bug: N/A
Test: ran tests
Change-Id: I07b4d937741e4dcd7e615f2371b17c827341917a
Bug: 36401135
Test: Actually enable debug malloc and verify it loads properly.
Test: Ran unit tests.
Change-Id: I9df1699b06bb14c5df2c3cab35dc2eb0819033f1
This is a bit bogus because it's been removed from glibc (though not
thoroughly) and is never useful on Android (because the system calls
in question are compiled out of Android kernels, and SELinux would
disallow them even if you weren't running an Android kernel). This
also means that on glibc you need to include <linux/sem.h> for this
and on bionic you need <sys/sem.h> (and for either if you #include
the other file, you won't get this union).
Bug: https://github.com/android-ndk/ndk/issues/400
Test: added new test
Change-Id: I47f721da77515531f616d6ad8479bfbc9b60ee47
This change
- adds a query hook to android_net_context
- exposes relevant definitions to netd
- corrects a bug in query hooks' interaction with the cache
This change does not introduce any code to read the query hook
from the net context or make use of it.
Bug: 34953048
Test: Netd test suite passes
Change-Id: Ie091980e22ce9da07a3c4d387b371e544379d762
It's going away, since we don't have a single library on device anymore,
and it's simpler to keep the host looking like the device. This doesn't
seem to need it anymore either -- the libraries are found relative to
the test binary.
Test: bionic/tests/run-on-host.sh glibc
Change-Id: Ie9bf6388ecd773623181ec9eadb35d6e0ba0a441
It's going away, so use the built versions in the per-library
intermediate directories instead.
Test: `m -j bionic-unit-tests` produces the same output before/after
Change-Id: Ia5cd874d13129b2be89cdc26e4ec598be4003c87
372f19e9e2 ("libc: ARM64: update memset/strlen/memcpy/memmove to
newlib/cortex-strings") introduced a bug in memset, only occurring
on the [set_long + zero + non-standard ZVA size] path, more
specifically when DCZID_EL0 reports a size different to 64 or 128.
On platforms with such sizes reported by DCZID_EL0, various string*
unit tests fail due to memset zeroing memory before and/or after the
area it is supposed to set.
Test: bionic-unit-tests --gtest_filter=string*
Change-Id: Idb80c0269226e40e343645a58608e3f324378468
Add the mallopt function, and only a single option so far.
Bug: 36401135
Test: Built and booted bullhead.
Test: Ran jemalloc unit tests.
Test: Ran bionic unit tests.
Test: Ran a test that allocated and free'd a large piece of memory,
Test: and verified that after changing the parameter, the PSS
Test: sticks around (decay timer set to 1), the PSS is purged (decay
Test: timer set to 0).
Change-Id: I6927929b0c539c1023d34772d9e26bb6a8a45877
Bug: 37647380
Test: Built target with cortex-a73 for both 32 bit/64 bit.
Test: Built target with cortex-a53.cortex-a57 for both 32 bit/64 bit.
Test: Ran bionic unit tests, ran art target tests.
(cherry picked from commit 6fca047b53)
Change-Id: I2c48e1bc7f4a3c4548d1c66f87eab19c8618a0b8
In pthread_leak.detach test, compare the memory usage after two same
scenarios - all children threads have exited. Thus, test emulated by
NativeBridge, which may reserve a memory pool, will pass if it's not
unbounded leak.
Bug: https://issuetracker.google.com/37920774
Test: CtsBionicTestCases
Change-Id: Ia51aa67bacb588284747652b36ea5d8e85bea832
__isthreaded is annoying for ARC++ and useless for everyone. Just hard-code
the value in ndk_cruft for LP32 and be done with it.
Bug: N/A
Test: builds
Change-Id: I08f11a404bbec55ed57cb1e18b5116163c7d7d13