Commit graph

21265 commits

Author SHA1 Message Date
Elliott Hughes
6c01208e90 Merge "Remove obsolete __stack_chk_fail_local." 2017-05-24 15:05:59 +00:00
Treehugger Robot
1f66c6d078 Merge "Fix _POSIX_THREAD_PROCESS_SHARED." 2017-05-24 07:13:36 +00:00
Elliott Hughes
4af220cfef Remove obsolete __stack_chk_fail_local.
Clang doesn't use this.

Bug: N/A
Test: x86 emulator builds and boots
Change-Id: I2865c0d568a644f61f34bdea539daff5224896bc
2017-05-23 16:43:30 -07:00
Elliott Hughes
81a5b6f558 Merge "Switch to inline assembler in crtbegin." 2017-05-23 23:40:00 +00:00
Elliott Hughes
94072fbb4e Switch to inline assembler in crtbegin.
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
2017-05-23 14:47:16 -07:00
Treehugger Robot
dc18a4be63 Merge "Make use of the DNS query hook in the netcontext" 2017-05-23 13:17:43 +00:00
Dan Willemsen
c777139e02 Merge "Move libdlext_... to NATIVE_TESTS instead of ETC" 2017-05-23 05:50:39 +00:00
Treehugger Robot
7bbe7cb619 Merge changes Iefdc1662,I8ee9ce62
* changes:
  Don't define IN_CLOEXEC/IN_NONBLOCK for pre-L.
  Undef EPOLL_CLOEXEC for pre-L.
2017-05-23 00:48:01 +00:00
Dan Willemsen
6718e0309e Move libdlext_... to NATIVE_TESTS instead of ETC
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
2017-05-22 17:36:16 -07:00
Ben Schwartz
90a83beb4d Make use of the DNS query hook in the netcontext
This will allow netd to run queries over TLS:
https://android-review.googlesource.com/#/c/391513/
https://android-review.googlesource.com/#/c/380593/

Bug: 34953048
Test: Device tests pass.  No issues during manual testing.
Change-Id: I8d613322307fc40cdba59b82599eda753697278f
2017-05-22 18:37:25 -04:00
Treehugger Robot
6e7f14d9f7 Merge "Add a netcontext variant of gethostbyname" 2017-05-22 22:29:10 +00:00
Dan Albert
5a215d7817 Don't define IN_CLOEXEC/IN_NONBLOCK for pre-L.
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
2017-05-22 12:58:18 -07:00
Dan Albert
cdfface662 Undef EPOLL_CLOEXEC for pre-L.
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
2017-05-22 12:52:00 -07:00
Ben Schwartz
dd878fe129 Add a netcontext variant of gethostbyname
Bug: 34953048
Test: Integration tests pass
Change-Id: I670427d67fde09d8e76ea6a920c90a1969230c4f
2017-05-22 10:19:25 -04:00
Treehugger Robot
4767bc4a6c Merge "Add a netcontext variant of gethostbyaddr" 2017-05-22 10:06:31 +00:00
Treehugger Robot
761bb2be4d Merge "Add the DNS query hook to net context" 2017-05-22 02:51:36 +00:00
Treehugger Robot
137a2cf967 Merge "Va_end should be used with va_start" 2017-05-20 22:08:12 +00:00
Mikhail Lappo
13ec1cf3da Va_end should be used with va_start
va_start is used and va_end should
be invoked accordingly

Change-Id: I2b0a2af762e22082a351a4d8139aaa48bc791e88
2017-05-20 13:20:41 -07:00
Elliott Hughes
468c8086e6 Fix _POSIX_THREAD_PROCESS_SHARED.
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
2017-05-20 13:11:14 -07:00
Christopher Ferris
8433d40f56 Merge "Fix missing function export." 2017-05-19 23:20:27 +00:00
Christopher Ferris
2b0f2a4855 Fix missing function export.
Bug: 36401135

Test: Actually enable debug malloc and verify it loads properly.
Test: Ran unit tests.
Change-Id: I9df1699b06bb14c5df2c3cab35dc2eb0819033f1
2017-05-19 13:47:16 -07:00
Elliott Hughes
8fbd15a6d0 Merge "Make union semun usable." 2017-05-19 18:24:09 +00:00
Elliott Hughes
497ad30d7d Make union semun usable.
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
2017-05-18 15:05:26 -07:00
Ben Schwartz
50178056f7 Add a netcontext variant of gethostbyaddr
Bug: 34953048
Test: Integration tests pass
Change-Id: Id04830345be56cd7a077981c6e2acfb5568e7a88
2017-05-18 14:32:21 -04:00
Ben Schwartz
f0305dcee9 Add the DNS query hook to net context
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
2017-05-18 12:03:11 -04:00
Treehugger Robot
f06535035e Merge "Fix Mac build." 2017-05-18 02:23:37 +00:00
Christopher Ferris
61073263d4 Merge "Make mallopt available in the future." 2017-05-18 02:23:07 +00:00
Treehugger Robot
f599b7285b Merge "Remove reference to obj/lib" 2017-05-18 01:49:39 +00:00
Elliott Hughes
3fa758f49c Fix Mac build.
Bug: N/A
Test: builds
Change-Id: Ia3dae9f86a0aaa5431929e790f5c36f8beaf3bed
2017-05-17 17:36:08 -07:00
Dan Willemsen
b02206a602 Remove reference to obj/lib
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
2017-05-17 16:49:56 -07:00
Treehugger Robot
7ff7ed1c7d Merge "tests/utils.h should #include <sys/sysmacros.h>" 2017-05-17 22:48:55 +00:00
Christopher Ferris
083923d96a Make mallopt available in the future.
I made this in 26 but it's really only available in the future.

Test: Built angler image.
Change-Id: I9e1179b350103bf1b8774459a9e210b377300d40
2017-05-17 14:48:59 -07:00
Dan Willemsen
afd629582b Merge "Stop using $(TARGET_OUT_INTERMEDIATE_LIBRARIES)" 2017-05-17 19:50:55 +00:00
Elliott Hughes
5d949da8a9 tests/utils.h should #include <sys/sysmacros.h>
Bug: https://github.com/android-ndk/ndk/issues/398
Test: builds
Change-Id: Ie81b49787d468e409db4024763f29946d3e4250f
2017-05-17 11:43:39 -07:00
Dan Willemsen
3d68fca0da Stop using $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
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
2017-05-16 15:25:35 -07:00
Christopher Ferris
6fba793bc3 Merge "libc: ARM64: fix memset for non-standard ZVA sizes" 2017-05-16 20:07:21 +00:00
Christopher Ferris
d84c30ddec Merge "Add support for modifying decay timer." 2017-05-16 14:02:53 +00:00
Kevin Brodsky
f19eeb8446 libc: ARM64: fix memset for non-standard ZVA sizes
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
2017-05-16 11:29:49 +01:00
Christopher Ferris
a1c0d2fd4c Add support for modifying decay timer.
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
2017-05-15 16:59:16 -07:00
Christopher Ferris
f0ddcc676c Merge "Add support for cortex-a73." 2017-05-15 22:00:44 +00:00
Christopher Ferris
94bd274551 Add support for cortex-a73.
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
2017-05-15 12:44:58 -07:00
Elliott Hughes
ac58d33d34 Merge "test: check unbounded memory leak in pthread detach" 2017-05-15 16:20:05 +00:00
Zhenhua WANG
cf17b487ef test: check unbounded memory leak in pthread detach
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
2017-05-12 11:09:45 -07:00
Treehugger Robot
d785b4465e Merge "Clean up __isthreaded." 2017-05-12 01:35:51 +00:00
Treehugger Robot
23672d30e2 Merge "Run bionic/libc/tools/genversion-scripts.py" 2017-05-11 23:52:15 +00:00
Elliott Hughes
dfcb82d92d Clean up __isthreaded.
__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
2017-05-11 15:29:03 -07:00
Elliott Hughes
a57476b661 Run bionic/libc/tools/genversion-scripts.py
When 2e8e5e60b6 was cherrypicked, we
didn't regenerate the generated files.

Bug: N/A
Test: builds
Change-Id: I87730e834520aea742738708237d11a798bf3220
2017-05-11 15:14:41 -07:00
Treehugger Robot
0e986b8d5d Merge "Fix clang-tidy perfomrance warnings." 2017-05-11 02:46:43 +00:00
wy
828b9e162f Fix clang-tidy perfomrance warnings.
Change-Id: Ibf3d32a5ba1cb70158d857be3d20aa3d1a870341
Test: build with WITH_TIDY=1
2017-05-10 15:57:26 -07:00
Treehugger Robot
a93fcd0394 Merge "greylist is no longer enabled by default." 2017-05-10 02:33:30 +00:00