Commit graph

30637 commits

Author SHA1 Message Date
Josh Gao
84d00460df Merge changes from topic "bionic_signal_platform_headers"
* changes:
  Move sigrtmin.h into platform headers.
  Move bionic_macros.h from private to platform.
2020-01-02 23:40:53 +00:00
Josh Gao
5074e7d28f Move sigrtmin.h into platform headers.
Test: mma
Change-Id: Ibc97ef96fe9e32b948c245b06039b95fe4342f39
2020-01-02 14:14:15 -08:00
Josh Gao
4956c372cf Move bionic_macros.h from private to platform.
Test: treehugger
Change-Id: Ie473914f4c8924c7240b3ac22093a9daf42fc948
2020-01-02 14:09:50 -08:00
NIEJuhu
e2871bd0d8 Do not add duplicate soinfos to g_default_namespace
The soinfo instances of linker and vdso have been added to g_default_namespace
before init_default_namespace() is called. So init_default_namespace() don't
have to add them a second time.

Test: manual
Change-Id: I29b3da782b1e9445509f45a7698561fc3e19e9a1
2019-12-27 11:32:29 +08:00
Logan Chien
e592dacfa2 Merge "versioner: Update libc.map.txt to match annotations" 2019-12-23 17:21:26 +00:00
Logan Chien
5a750f3cf7 versioner: Add __VERSIONER_FORTIFY_INLINE
This commit adds `__VERSIONER_FORTIFY_INLINE` to fortify overload
functions.  Fortified functions are always overloaded and are likely to
be different from `libc.map.txt`.

Bug: 118991081
Test: source development/vndk/tools/header-checker/android/envsetup.sh && \
      source build/envsetup.sh && \
      lunch aosp_arm64-userdebug && \
      m versioner && \
      ./bionic/tools/versioner/run_tests.py
Change-Id: I28903d0f039d74a07eb2833c754ff017335bac95
2019-12-23 07:22:48 -08:00
Logan Chien
c88331b062 versioner: Add versioner_fortify_inline annotation
This commit adds versioner_fortify_inline annotation.  This annotation
indicates that the annotated function is an overloaded inline function
for _FORTIFY_SOURCE implementation.  They are usually enabled/disabled
by the enable_if attribute, thus the versioner don't have to check
whether they have conflicting definitions.

Bug: 118991081
Test: source development/vndk/tools/header-checker/android/envsetup.sh && \
      source build/envsetup.sh && \
      lunch aosp_arm64-userdebug && \
      m versioner && \
      ./bionic/tools/versioner/run_tests.py
Change-Id: If5c739fc0c8a218907855939c1fe5338134da7f7
2019-12-23 07:22:48 -08:00
Logan Chien
d7d9ebca37 versioner: Only enable annotation while running versioner
Bug: 118991081
Test: source development/vndk/tools/header-checker/android/envsetup.sh && \
      source build/envsetup.sh && \
      lunch aosp_arm64-userdebug && \
      m versioner && \
      ./bionic/tools/versioner/run_tests.py
Change-Id: Id6cc776f8ea27bf7230c7a63dd75445a99e5ba58
2019-12-23 07:22:48 -08:00
Logan Chien
a6bf7f2ee3 versioner: Add a built-in macro for conditional compilation
This commit adds a built-in macro for conditional compilation because
__attribute__((annotate(...))) may pull unused static inline functions
into object files.

We must not generate those functions in object files because it can
result in undefined references to __strchr_chk on linux_glibc.

Bug: 118991081
Test: source development/vndk/tools/header-checker/android/envsetup.sh && \
      source build/envsetup.sh && \
      lunch aosp_arm64-userdebug && \
      m versioner && \
      ./bionic/tools/versioner/run_tests.py
Change-Id: I0c9d967413ec8e8655e91316973a79b81e2129b1
2019-12-23 07:14:05 -08:00
Logan Chien
d98dac41df versioner: Fix fortified sendto
This commit fixes an error in fortified `sendto` function.  Since
`__sendto_chk` is only introduced in API 26, the usage should be guarded
with `__ANDROID__API__ >= 26` instead of
`__ANDROID_API__ >= __ANDROID_API_N_MR1__` (25).

Bug: 118991081
Test: source development/vndk/tools/header-checker/android/envsetup.sh && \
      source build/envsetup.sh && \
      lunch aosp_arm64-userdebug && \
      m versioner && \
      ./bionic/tools/versioner/run_tests.py
Change-Id: Ibc08244645c3fe76a72d0107138f67ffd56f5caa
2019-12-23 07:14:05 -08:00
Logan Chien
aaffa3c6d4 versioner: Update libc.map.txt to match annotations
This commit removes several symbol versions (API 14 and 15) from
`libc.map.txt` because we no longer support NDK with those API levels.
This also matches the versioner annotations in the header files.

This commit also annotates twalk() with __INTRODUCED_IN(21).  It was
accidentally removed in aosp/1157510.

Test: source development/vndk/tools/header-checker/android/envsetup.sh && \
      source build/envsetup.sh && \
      lunch aosp_arm64-userdebug && \
      m versioner && \
      ./bionic/tools/versioner/run_tests.py
Change-Id: I211fe5b7b1b66793d5e76a8676f9d18825f96b5e
2019-12-23 07:13:33 -08:00
Elliott Hughes
5e2ac29165 Merge "Stop using the __ANDROID_API_x__ constants." 2019-12-23 03:26:37 +00:00
Treehugger Robot
8cdacf9760 Merge "Make the linker NOTICE file match the linker source." 2019-12-20 21:40:52 +00:00
Elliott Hughes
95c6cd753f Stop using the __ANDROID_API_x__ constants.
Historically we've made a few mistakes where they haven't matched the
right number. And most non-Googlers are much more familiar with the
numbers, so it seems to make sense to rely more on them. Especially in
header files, which we actually expect real people to have to read from
time to time.

Test: treehugger
Change-Id: I0d4a97454ee108de1d32f21df285315c5488d886
2019-12-20 13:26:14 -08:00
Elliott Hughes
fa8774462f Make the linker NOTICE file match the linker source.
Test: eyeball
Change-Id: I3e10bd813eff5cc05fc9c4f50a75777b82df9a5c
2019-12-20 12:29:39 -08:00
Christopher Ferris
508d270886 Merge "Run memunreachable_unit_test on bionic changes." 2019-12-20 02:25:44 +00:00
Christopher Ferris
0442b9f0c4 Run memunreachable_unit_test on bionic changes.
Bug: 137795072

Test: Ran atest.
Change-Id: I2153b3fd97f77bb06e9d66b5f5419cab0cbabcab
2019-12-19 15:58:48 -08:00
Treehugger Robot
f4e03ef45b Merge "Revert "Enable the scudo native allocator."" 2019-12-19 20:52:02 +00:00
Ytai Ben-tsvi
5105ece816 Revert "Enable the scudo native allocator."
This reverts commit 6ffbe97859.

Reason for revert: Droidcop-triggered revert due to breakage b/146543543

Change-Id: Ie9a5b2f6ca5dbc8d3c6cafe70e34838d74e45c56
Bug: 146543543
2019-12-19 19:09:59 +00:00
Christopher Ferris
414d98648a Merge "Enable the scudo native allocator." 2019-12-18 23:36:32 +00:00
Christopher Ferris
6ffbe97859 Enable the scudo native allocator.
Bug: 137795072

Test: Built both svelte and non-svelte versions. Ran enormous numbers
Test: of performance testing.
Test: Ran scudo unit tests.
Test: Ran bionic unit tests.
Change-Id: Iec6c98f2bdf6e0d5a6d18dff0c0883fac391c6d5
2019-12-18 12:27:40 -08:00
Wenhao Wang
35ee9d9a9f Merge "Add scsi directory" 2019-12-17 23:41:57 +00:00
Wenhao Wang
69537f1e2a Add scsi directory
This CL exports bionic/libc/kernel/android/scsi directory
to enable the usage of header files (e.g. sg.h) on that directory.

Test: Build AOSP 1187028
Change-Id: If580fcbc67378fab42d4f14cca1de337b603b673
2019-12-17 14:05:47 -08:00
Evgeny Eltsin
4ea64e91e8 Merge "Fix dlext.ns_anonymous test for native bridge" 2019-12-17 19:22:04 +00:00
Evgeny Eltsin
0530f5ffd7 Merge "Fix signal.sigwait64_SIGRTMIN test" 2019-12-17 18:12:21 +00:00
Christopher Ferris
e05ed218fd Merge "Add support for scudo svelte." 2019-12-17 18:05:03 +00:00
Evgeny Eltsin
ad865d7b3d Fix dlext.ns_anonymous test for native bridge
The executable flag might not be present for the executable segment
if the code is being handled by native bridge implementation. Old
heuristics for this case was to assume first segment is executable.
This doesn't stand any more. Instead, look for segment that contains
the function test is going to call.

Test: bionic-unit-tests --gtest_filter=dlext.ns_anonymous
Change-Id: I960bebba86e225d739b73f6d093e145fff17b4a8
2019-12-17 18:54:17 +01:00
Evgeny Eltsin
4d9264c593 Fix signal.sigwait64_SIGRTMIN test
'kill(pid, sig)' sends signal to arbitrary thread within a process, thus
test was occasionally sending signal to the killing thread, not to the
waiting thread. Use 'tgkill(pid, tid, sig)' instead.

Test: bionic-unit-tests --gtest_filter=signal.sigwait64_SIGRTMIN
Change-Id: I80377295e2362cb87eb4fb4de2489c51c520ea77
2019-12-17 18:03:06 +01:00
Treehugger Robot
573ddbab3f Merge "Do not DL_WARN when failed to find generated linker config" 2019-12-17 08:31:31 +00:00
Kiyoung Kim
19f95dd872 Do not DL_WARN when failed to find generated linker config
DL_WARN message when failed to find generated linker config makes some
of the ART tests fail. Lowering log level as ART test does not have
linkerconfig generated for the test.

Bug: 146386369
Test: Cuttlefish boot succeeded without any error
Test: run_build_test_target.py art-linux-bionic-x64-zipapex passed
Change-Id: I4f876c3ac5c30d32d51346d4cd16b5205da8f1bf
2019-12-17 13:59:57 +09:00
Christopher Ferris
e1fd409fcb Add support for scudo svelte.
Bug: 137795072

Test: Built with scudo and scudo svelte.
Change-Id: Ib2afd5249b897b818012ee71547af1f4ee60201b
2019-12-16 16:22:55 -08:00
Evgeny Eltsin
5761dd85b6 Merge "Prefer arch-specific linker config when available" 2019-12-16 19:59:14 +00:00
Evgeny Eltsin
ff43ec0147 Prefer arch-specific linker config when available
New linker configuration from /linkerconfig is not suitbale for emulated
architectures. But as of now, native_bridge linkers pick it up as well
and thus fail to find the libraries for emulated architectures.

This is a (temporary) fix so native_bridge linker still picks up
configuration from old location.

Bug: 138920271
Test: native_bridge linker works
Change-Id: I0abbd3e95f9e6830385b0f19db0688e6183030b9
2019-12-16 19:22:07 +01:00
Evgeny Eltsin
a8f98b4fa5 Merge "Make android_mallopt weak for native bridge" 2019-12-16 18:14:31 +00:00
Christopher Ferris
c58208bd3a Merge "Update documentation around kernel header imports." 2019-12-16 17:48:52 +00:00
Evgeny Eltsin
403b99d44a Merge "Increase sleep time in sigwait64_SIGRTMIN test" 2019-12-16 17:35:29 +00:00
Peter Collingbourne
e5dbd3f71b Merge "Update bionic to use the MTE API proposed on LKML." 2019-12-16 17:02:11 +00:00
Evgeny Eltsin
b29173cd64 Increase sleep time in sigwait64_SIGRTMIN test
With previous sleep time, if unlucky, newly started thread can send
signal before main thread starts sigwait.

Test: bionic-unit-tests --gtest_filter=signal.sigwait64_SIGRTMIN
Change-Id: I63d7825a695988e388903c7951e2435cb69773a1
2019-12-16 17:01:11 +01:00
Evgeny Eltsin
edbc9e2074 Make android_mallopt weak for native bridge
It is not intercepted by malloc hooks.

Test: bionic-unit-tests --gtest_filter=android_mallopt*
Change-Id: I3fb4101bdcdb62d82a09212fda9eafff7f43c786
2019-12-16 16:37:44 +01:00
Kiyoung Kim
838ca10715 Merge "Enable linker configuration from generator by default" 2019-12-16 01:55:44 +00:00
Treehugger Robot
0c42fa4956 Merge "Clone with --depth 1 in generate_uapi_headers.sh --download-kernel." 2019-12-14 06:00:32 +00:00
Josh Gao
afe7e53003 Clone with --depth 1 in generate_uapi_headers.sh --download-kernel.
Test: manual
Change-Id: Id60b354fb1914470315976dd103d2665a6fefab8
2019-12-13 17:24:44 -08:00
Christopher Ferris
86a8f3f32d Update documentation around kernel header imports.
Test: NA
Change-Id: I8866ef30efbc565e8996c574a9f895c574cd8e55
2019-12-13 17:20:20 -08:00
Christopher Ferris
0d61854b39 Merge "Update to android-mainline kernel headers v5.4." 2019-12-13 21:39:54 +00:00
Peter Collingbourne
e5e7395c9f Update bionic to use the MTE API proposed on LKML.
Patch set available here:
https://lore.kernel.org/linux-arm-kernel/20191211184027.20130-1-catalin.marinas@arm.com/
and in my android-experimental-mte branch.

Bug: 135772972
Change-Id: Ib46fd508330b330ef3afc713a9a4e26675ddb857
2019-12-13 12:13:29 -08:00
Kiyoung Kim
ef04c80bf6 Enable linker configuration from generator by default
Current linker configuration is only enabled from fully treblelized
devices. This change will allow linker to first check generated linker
configuration even for non-treblelized devices and recovery.

Bug: 139638519
Test: Tested from cuttlefish
Change-Id: I655b1ab807cd8db5696d07fd2bdd00ce0558901d
2019-12-13 13:59:00 +09:00
Elliott Hughes
b8c16c02e8 Merge "Make private/bionic_page.h available as platform/bionic/page.h." 2019-12-13 01:32:11 +00:00
Treehugger Robot
024f067061 Merge "Use the canonical form of the APL2 boilerplate." 2019-12-13 01:22:17 +00:00
Elliott Hughes
b030de25b8 Use the canonical form of the APL2 boilerplate.
Test: repo upload hooks
Change-Id: I49fd4d3131d0cc7f26cdc380d180a950c070541a
2019-12-12 15:32:10 -08:00
Elliott Hughes
cdb52fc147 Make private/bionic_page.h available as platform/bionic/page.h.
Bug: http://b/145825270
Test: treehugger
Change-Id: I52958f370c0df2c02cb8250e2cf0705d4e93e908
2019-12-12 15:26:14 -08:00