Commit graph

31652 commits

Author SHA1 Message Date
Dan Albert
a4110def5c Merge "Add api-level.h to dac, improve docs." 2020-08-11 23:19:21 +00:00
Dan Albert
d8f46916b6 Add api-level.h to dac, improve docs.
We don't list most of bionic on dac since it would be overwhelming for
the current layout, but this file in particular seems useful,
especially __ANDROID_API__. Unfortunately, c2devsite doesn't include
macro documentation. Until then, it's still useful to include the
functions defined in this header.

I've also elaborated a bit in the __ANDROID_API__ documentation, since
the existing phrasing led to confusion over whether it was closer to
minSdkVersion or compileSdkVersion. In practice these are identical
for the NDK, but if we switch to weakly-linked APIs via the
availability attribute that would change.

Test: built docs, looked at them
Bug: None
Change-Id: I5cf78a6143b5c15790c369bdf888611e4c1189db
2020-08-11 13:50:04 -07:00
Elliott Hughes
8880f5ecf3 Merge "Improve the coverage script." 2020-08-11 19:30:50 +00:00
Elliott Hughes
7f354436f2 Improve the coverage script.
This now works for ARM as well as Intel.

Also combine both the 32-bit and 64-bit results (since we have code
that's only executed in one variant or the other, the union of the two
seems like what we actually want to measure).

Also make the script executable.

Test: ./bionic/build/coverage.sh
Change-Id: I4e3a7f4cd60fda060b956a960cfb9b703d3670e7
2020-08-11 10:00:30 -07:00
Elliott Hughes
f08e70a0d9 Merge "Reimplement our no-op utmp.h functions more simply." 2020-08-10 15:41:13 +00:00
Elliott Hughes
9a1d3976f1 Reimplement our no-op utmp.h functions more simply.
Now we're being marked down for our poor coverage, we may as well remove
more broken cruft. Despite the amount of effort that seems to have gone
into pututline(), it wasn't working with the other utmp.h functions (in
particular, utmpname()), and wasn't declared in the header file!

Test: treehugger
Change-Id: I1a583984189c751168c11c01431433f96f8c548b
2020-08-07 17:07:31 -07:00
Treehugger Robot
5ca9a15245 Merge "Make swab(3) inline prior to API 28." 2020-08-07 22:11:17 +00:00
Dan Albert
2dbea434d1 Make swab(3) inline prior to API 28.
Test: make checkbuild
Bug: https://stackoverflow.com/q/54392471/632035
Change-Id: Iaeb55231ea2395d7e1e31be63034f5db19025060
2020-08-07 13:10:51 -07:00
Elliott Hughes
422b2044ea Merge "Switch to musl memmem (via OpenBSD)." 2020-08-07 20:01:17 +00:00
Treehugger Robot
cc8f1ea9e1 Merge "Allow native_bridge to intercept __get_thread()->stack_top" 2020-08-07 05:52:52 +00:00
Treehugger Robot
6900a09fe7 Merge "Trivial strxfrm coverage improvement." 2020-08-06 22:23:50 +00:00
Elliott Hughes
5633caa285 Switch to musl memmem (via OpenBSD).
Similar to the musl strstr. This patch also increases test coverage for
memmem, again similar to the strstr tests.

Test: treehugger
Change-Id: I7f4a2ab93a610cb692994d06d2512976e657ae9f
2020-08-06 14:33:48 -07:00
Elliott Hughes
2e71c17778 Trivial strxfrm coverage improvement.
Test: treehugger
Change-Id: I450bd3324c3f0f8ab95cecebe0f57dc85acc2996
2020-08-06 13:53:40 -07:00
Christopher Ferris
eebb1ec687 Merge "Update to v5.8 kernel headers." 2020-08-06 16:31:03 +00:00
Treehugger Robot
7f65348eb0 Merge "Add linkerconfig to the host exports." 2020-08-06 10:25:39 +00:00
Martin Stjernholm
d6e35f1cc8 Add linkerconfig to the host exports.
ART runs it on host to create the linker config for its chroot test
environment. This avoids problems building linkerconfig in the reduced
master-art manifest.

Even though linkerconfig currently is in platform/system I'm adding it
to the Bionic module exports based on discussions that the linkerconfig
binary should be part of the Runtime (Bionic) APEX due to its close
ties to the linker.

Test: build/soong/scripts/build-aml-prebuilts.sh runtime-module-host-exports
  then try the prebuilt snapshot with art/tools/buildbot-build.sh in
  master-art
Bug: 162819454
Change-Id: I4d43d7f0b980af48b193d5eb358e4f010eea541b
2020-08-06 11:21:40 +01:00
Treehugger Robot
8743c15a64 Merge "Add a script to generate coverage." 2020-08-06 01:04:57 +00:00
Treehugger Robot
e41012fe2e Merge "Enable coverage for libc." 2020-08-05 23:23:48 +00:00
Pirama Arumuga Nainar
abf40321a1 Add a script to generate coverage.
1. Prereqs: Coverage-enabled build.
  $ lunch <target>
  $ m NATIVE_COVERAGE_PATHS="bionic" CLANG_COVERAGE=true
  $ m NATIVE_COVERAGE_PATHS="bionic" CLANG_COVERAGE=true bionic-unit-tests
2. Flash image and set $ANDROID_SERIAL
3. $ bionic/build/coverage.sh

HTML report is generated to /tmp/bionic-coverage

Test: build/coverage.sh
Change-Id: I33c7d47d218a68a250076f063cfbdbaab91acc74
2020-08-05 15:53:19 -07:00
Pirama Arumuga Nainar
8035caa311 Enable coverage for libc.
Bug: http://b/157081822

- Disable coverage for libtest_check_rtld_next_from_library to make
dlfcn.rtld_next_from_library to pass.
- The coverage runtime sets an environment variable to prevent
clobbering of the coverage data on disk.  Include that variable as well
when checking `printenv` output.  This is done at runtime by checking
for LLVM_PROFILE_FILE environment variable.
- dl.preinit_system_calls still fails after this change.

Test: bionic tests with libc coverage turned on.

Change-Id: I3ea2b0800886d8c0984969a4ee8bfb0da03c33b0
2020-08-05 14:58:40 -07:00
Ryan Prichard
159b140661 Merge "Rename linker greylist to exempt-list" 2020-08-04 21:41:29 +00:00
Christopher Ferris
8177cdf178 Update to v5.8 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-5.8

Test: NA
Change-Id: I2231c877589820fc09800a200cf4ac62ba74b04c
2020-08-04 13:50:49 -07:00
Steven Moreland
7591bb5ee1 Merge "SCUDO fill options only when USE_SCUDO" 2020-08-04 17:47:36 +00:00
Treehugger Robot
d9fc1a72d9 Merge "Moving bionic_systrace.cpp out of libc_bionic_ndk" 2020-08-04 14:46:04 +00:00
Bowgo Tsai
a9208f3ac2 Moving bionic_systrace.cpp out of libc_bionic_ndk
We'll be enabling system tracing in libsystemproperties, which requires
using bionic_systrace.cpp from libc_bionic_ndk. However, libc_bionic_ndk
already depends on libsystemproperties.

Introducing a new library libc_bionic_systrace for bionic_systrace.cpp,
which can be used by both libc_bionic_ndk and libsystemproperties.

Bug: 147275573
Test: atest CtsBionicTestCases
Test: adb shell perfetto -o /data/misc/perfetto-traces/test_trace -t 10s bionic
Change-Id: I7306f922f212fa1c911583e1922e33612bfeada6
2020-08-04 11:08:05 +08:00
Ryan Prichard
aff9a34bd8 Rename linker greylist to exempt-list
Update a comment in android-changes-for-ndk-developers.md about the
removed debug.ld.greylist_disabled system property.

Update language to comply with Android's inclusive language guidance

  #inclusivefixit

See https://source.android.com/setup/contribute/respectful-code for reference

Bug: http://b/162536543
Test: bionic-unit-tests
Change-Id: I760ee14bce14d9d799926c43d2c14fd8ffbc6968
2020-08-03 16:17:00 -07:00
Evgeny Eltsin
95dbcfaf04 Merge "Fix __clone_for_fork attributes" 2020-08-03 18:28:25 +00:00
Treehugger Robot
0f4bdb04fb Merge "linker: Cleanup for Android's inclusive language guidance" 2020-08-02 14:48:01 +00:00
Evgeny Eltsin
61be80182c Fix __clone_for_fork attributes
Avoid name mangling and ensure no export.

Bug: 162625883
Test: bionic-unit-tests
Change-Id: If7700772e0a8c7a52be890d55ecdac33185f6b78
2020-08-01 13:33:01 +02:00
Evgeny Eltsin
f69030095d Allow native_bridge to intercept __get_thread()->stack_top
Bug: 158584334
Test: bionic-unit-tests --gtest_filter=android_unsafe_frame_pointer_chase*
Change-Id: Ib58372991027846eb35c7e393de321910fa92997
2020-08-01 13:29:03 +02:00
Ryan Prichard
89f907cfe4 Merge "Remove debug.ld.greylist_disabled property" 2020-07-31 23:56:10 +00:00
Elliott Hughes
907e0aebd2 Merge "Sync with upstream OpenBSD." 2020-07-31 23:47:05 +00:00
Treehugger Robot
0cfe54966b Merge "Sync with upstream NetBSD." 2020-07-31 21:14:34 +00:00
Elliott Hughes
26b06073f6 Sync with upstream OpenBSD.
Test: treehugger
Change-Id: I1fc649ba5d79a3d95242c6b2240dbb05c85d30e9
2020-07-31 13:01:38 -07:00
Elliott Hughes
79c91ae43b Sync with upstream NetBSD.
Test: treehugger
Change-Id: Ia88698f032c017fabc8d24bab12f33ed0b55e65e
2020-07-31 12:59:48 -07:00
Treehugger Robot
cde09224eb Merge "More cleanup for #inclusivefixit." 2020-07-31 19:09:57 +00:00
Steven Moreland
fb65ee4c47 SCUDO fill options only when USE_SCUDO
For vanity reasons, this CL should be reverted after b/158870657, since
we want to make sure zero/pattern fill always happen when they are
requested.

Bug: 131355925
Bug: 158870657
Test: check build on normal devices hits USE_SCUDO branch with #error
Change-Id: I22d19dbc75004c8f7437e1247226bc3275cd4df5
2020-07-31 17:45:44 +00:00
Elliott Hughes
cf346532fc More cleanup for #inclusivefixit.
Found manually with grep, since the script seems to miss stuff.

Test: treehugger
Change-Id: I5933cbade9792801d4a0bec1ccb077efa6ad8fbc
2020-07-31 10:35:03 -07:00
Luke Huang
30f2f053f2 linker: Cleanup for Android's inclusive language guidance
1. Cleanup for #inclusivefixit. (whitelisted -> allowed_libs)
2. Support the old term for backwards compatibility. (Also update test.)
3. Fix the formatting errors found by clang-format.

See https://source.android.com/setup/contribute/respectful-code
for reference.

Bug: 161896447
Test: atest linker-unit-tests linker-benchmarks
Change-Id: I19dbed27a6d874ac0049cb7b67d2cb0f75369c1b
2020-07-31 11:37:28 +08:00
Ryan Prichard
238609328f Remove debug.ld.greylist_disabled property
This property provided a way to disable the greylist, for testing
whether an app targeting < 24 still works. Instead of turning off the
greylist, though, an app developer should simply target a newer API.

(If app developers really need this property for testing, they can
still use it on versions of Android between N and R, inclusive.)

Update language to comply with Android's inclusive language guidance

See https://source.android.com/setup/contribute/respectful-code for reference

#inclusivefixit

Bug: http://b/162536543
Test: bionic-unit-tests
Change-Id: Id1eb2807fbb7436dc9ed7fe47e15b7d165a26789
2020-07-30 19:29:17 -07:00
Treehugger Robot
b1d27cab96 Merge "Cleanup for #inclusivefixit." 2020-07-30 22:47:23 +00:00
Elliott Hughes
c2c9b420bd Cleanup for #inclusivefixit.
Not sure how this one got missed earlier.

Test: treehugger
Change-Id: Ia4e6f62a3d33d3ac01e3d7db836caadeed0ff63b
Bug: 161896447
2020-07-30 21:19:45 +00:00
Christopher Ferris
3025f128f3 Merge "Add support for new scudo mallopt options." 2020-07-29 16:38:06 +00:00
Christopher Parsons
5b2e331211 Merge "Move prebuilt library dependencies of bionic-unit-tests to Blueprint" 2020-07-29 15:37:15 +00:00
Chris Parsons
cab794c22f Move prebuilt library dependencies of bionic-unit-tests to Blueprint
Test: atest CtsBionicTestCases
Test: m bionic-unit-tests && adb sync data && \
  adb shell /data/nativetest[64]/bionic-unit-tests/bionic-unit-tests
Change-Id: I94b1eacfe496375853a476bd6c6702d09cfdbcce
2020-07-28 19:01:00 -07:00
Christopher Ferris
8844879212 Add support for new scudo mallopt options.
Bug: 162092537

Test: Ran new unit tests.
Change-Id: I4b7d17a9e98166c03cd153eb9e9d847693914ea3
2020-07-28 18:20:32 -07:00
Treehugger Robot
72ac49dbd8 Merge "Remove pylintrc." 2020-07-29 01:12:56 +00:00
Treehugger Robot
4d3802baa4 Merge "Cleanup for #inclusivefixit." 2020-07-28 19:38:41 +00:00
Tom Cherry
15786e407f Cleanup for #inclusivefixit.
Test: build
Change-Id: Ib2f264feae69fbbda5fe1e1c315b6116ecf520fa
2020-07-28 10:56:12 -07:00
Dan Albert
9dd11412a6 Remove pylintrc.
Considering none of the files in this directory are pylint clean I
don't think this is being used. They also seem to use a mix of styles
so we need to either unify or split things into subdirectories if we
want to use pylint here.

Test: None
Bug: http://b/161896447
Change-Id: I5bc298bd64d44cc10d3d28121666e7893222ea96
2020-07-27 13:40:28 -07:00