Commit graph

32897 commits

Author SHA1 Message Date
Stephen Hines
760647791f Adapt for update to clang-r399163.
This is really just a case of including the proper header for a
function.

Bug: http://b/155835175
Test: OUT_DIR=out prebuilts/clang-tools/build-prebuilts.sh
Change-Id: I0523d3ccd8cb502e8c2b8f72f137db4b60fb1dac
2020-09-22 13:37:42 -07:00
Treehugger Robot
0a12075ca4 Merge "Add arm64 source to linker_wrapper" 2020-09-22 04:23:45 +00:00
Jiyong Park
3b47d603fa Add arm64 source to linker_wrapper
As we enable arm64-based Bionic host target (linux_bionic_arm64),
linker_wrapper is added with the corresponding source.

Bug: 159685774
Test: HOST_CROSS_OS=linux_bionic HOST_CROSS_ARCH=arm64 m
Test: copy out/soong/host/linux_bionic_arm64/ to an ARM64 emulator
running Linux and execute the binaries

Change-Id: I4f367a349f7e0015318352cb7f2870fc856eab05
2020-09-22 11:28:22 +09:00
Tom Cherry
6c19d67a73 Merge "Explicitly add the include path for android_filesystem_config.h" 2020-09-21 20:35:31 +00:00
Tom Cherry
379ed1ef62 Explicitly add the include path for android_filesystem_config.h
android_filesystem_config.h is found since system/core/include is on
the include path for all projects and contains a symlink to the real
android_filesystem_config.h.  This is fragile and the below bug seeks
to remove this symlink and have users correctly depend on
libcutils_headers.

In bionic, libcutils_headers header library cannot be used due to
cyclic dependencies, so it gets the actual include path instead, which
is less bad than depending on the build system injecting the for all
modules.

Bug: 165825252
Test: build
Change-Id: Id43bdea9553b1174ceb3efc2a3ed505888619c62
2020-09-21 10:09:25 -07:00
Lev Rumyantsev
bfb889002b Merge "Simplify native bridge skip check" 2020-09-19 01:58:08 +00:00
Lev Rumyantsev
37c5ed3e50 Simplify native bridge skip check
A follow-up to r.android.com/1430136.

Test: CtsBionicTestCases
Bug: None
Change-Id: I372bc0866b1d286637d3671f82be83cec1027bca
2020-09-18 15:09:01 -07:00
Peter Collingbourne
cf69abc0f4 Merge "Dump the per-thread TAGGED_ADDR_CTRL value if available." 2020-09-18 22:00:53 +00:00
Bill Yi
f15d33e2f9 Merge "Merge mainline-release 6664920 to master - DO NOT MERGE" 2020-09-18 18:47:54 +00:00
Bill Yi
e320c77e47 Merge mainline-release 6664920 to master - DO NOT MERGE
Merged-In: I91b84c489668ae1cac5a8143a9350e3ab625afdb
Change-Id: Id39b07cab134b03e42729cd0a7ca91990468d63e
2020-09-17 21:56:54 -07:00
Treehugger Robot
d7f153f9b9 Merge "Merge android11-tests-dev." 2020-09-18 01:15:30 +00:00
Treehugger Robot
60a39566f0 Merge "Make it clearer that math.h isn't fdlibm." 2020-09-18 00:50:31 +00:00
Elliott Hughes
fee514e714 Make it clearer that math.h isn't fdlibm.
It was originally based on fdlibm, but it's been through two different
projects since then, and `git blame` shows basically nothing remaining
from those days. Seems worth leaving something to explain the unusual
copyright header though!

Test: treehugger
Change-Id: I8e7252a755704b866e7f36c8e97adc021fa3cdad
2020-09-17 11:57:50 -07:00
Peter Collingbourne
98d79de51d Dump the per-thread TAGGED_ADDR_CTRL value if available.
This value indicates whether memory tagging is enabled on a thread,
the mode (sync or async) and the set of excluded tags. This information
can sometimes be important for understanding an MTE related crash,
so include it in the per-thread tombstone output.

Bug: 135772972
Change-Id: I25a16e10ac7fbb2b1ab2a961a5279f787039000b
2020-09-15 21:32:36 -07:00
Kiyoung Kim
66ae134614 Merge "Mark bionic APEX as visible" 2020-09-16 01:47:23 +00:00
Xin Li
6525d54985 Merge android11-tests-dev.
Bug: 168333982
Change-Id: If3eab22f2691623cbbbbf555587955a3a58a3b71
2020-09-14 17:17:34 -07:00
Elliott Hughes
1efa573832 Merge "Expose a function to reset the stack protector for the zygote." 2020-09-11 18:47:05 +00:00
Elliott Hughes
a1e3f2c502 Expose a function to reset the stack protector for the zygote.
This is already covered by the existing test by virtue of being used for
all threads.

Bug: http://b/168258494
Test: treehugger
Change-Id: I5c872fd7f30a4c79de1d70e7702f4b12d4e94cd3
2020-09-11 08:56:58 -07:00
Peter Collingbourne
bba9153c5c Merge "Implement a new mechanism to let Scudo access the TLS slot" 2020-09-10 23:02:03 +00:00
Peter Collingbourne
38d290a11d Implement a new mechanism to let Scudo access the TLS slot
An upcoming change to Scudo will change how we use the TLS slot
in tsd_shared.h, which will be a little easier to deal with if
we can remove the code path that calls pthread_getspecific and
pthread_setspecific. The only known user of this code path is Fuchsia.

We can't eliminate this code path by making Fuchsia use ELF TLS
because although Fuchsia supports ELF TLS, it is not supported within
libc itself. To address this, Roland McGrath on the Fuchsia team has
proposed that Scudo will optionally call a platform-provided function
to access a TLS slot reserved for Scudo. Android also has a reserved
TLS slot, but the code that accesses the TLS slot lives in Scudo.

We can eliminate some complexity and duplicated code by having Android
implement the same mechanism that was proposed for Fuchsia, which is
what this change does. A separate change to Scudo will make use of it.

Bug: 163630045
Change-Id: I4678105c9c47a23feb5a5e80a314416de4556d9c
2020-09-10 13:55:24 -07:00
Elliott Hughes
ba4b40602a Merge "NGREG != ELF_NGREG." am: a5a9992671
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1419433

Change-Id: I9447c49cd08bfac0f127229455529bffdfd23c56
2020-09-09 20:17:43 +00:00
Elliott Hughes
a5a9992671 Merge "NGREG != ELF_NGREG." 2020-09-09 19:54:46 +00:00
Kiyoung Kim
5a8189f141 Mark bionic APEX as visible
Linkerconfig is going to remove all hard-coded dependencies from APEX
modules and let APEX modules specify its own requirements. As part of
it, this change adds a new configuration file for linkerconfig and let
it aware that bionic APEX should be visible from all sections.

Bug: 167946001
Test: atest passed
Change-Id: If934d9a3e72b1466ee0d7bbb66d9383b90986a6b
2020-09-09 16:28:20 +09:00
Elliott Hughes
8e5fc5b037 NGREG != ELF_NGREG.
Except they are the same on arm32/arm64, so we hadn't really noticed. x86
and x86-64 are quite different though, presumably by historical accident.

Fix the definitions and add some static asserts.

Bug: https://github.com/android/ndk/issues/1347
Test: treehugger
Change-Id: Ic27b172066cf3443749463b9b73c912d204f9516
2020-09-08 09:27:02 -07:00
Xin Li
86214f6d88 Merge "Skip RP1A.200720.011" into stage-aosp-master 2020-09-02 19:15:47 +00:00
Tom Cherry
4473d90316 Merge "Add benchmark for property mapping" am: 7e0816a0a4
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1417669

Change-Id: I357733be71ebedf37dcf28d49f24c0dcdf149493
2020-09-02 19:05:58 +00:00
Xin Li
59cee9f405 Skip RP1A.200720.011
Bug: 167588565
Merged-In: I99d71533c73a721877bd43fa759912c7c5b60351
Change-Id: I55c193a9b35db7d2516296c79c33fa2837b3e54b
2020-09-02 12:01:10 -07:00
Xin Li
204da165b1 Mark RP1A.200720.001 as merged
Bug: 167588565
Merged-In: Ic00db40d010c75b2384796c19751226bec5519fd
Change-Id: If4e3cddf2e03fb529a2830a3988f97ce557222db
2020-09-02 11:44:47 -07:00
Tom Cherry
7e0816a0a4 Merge "Add benchmark for property mapping" 2020-09-02 18:25:16 +00:00
Tom Cherry
a5744e213f Add benchmark for property mapping
This benchmarks mapping property prefixes to property contexts with
two algorithms: the 'Legacy' method used before Android P and the
'Trie' used afterwards (the code in this directory).

It uses input mappings from both Oreo and the latest in AOSP ('S').
Note that there is nearly a 10x increase in the number of mappings in
S as there was in Oreo, which was predicted when the trie was
designed.

Results on cuttlefish:
-----------------------------------------------------------
Benchmark                 Time             CPU   Iterations
-----------------------------------------------------------
LegacyLookupOreo     683576 ns       673538 ns         1060
LegacyLookupS       5683109 ns      5596982 ns          124
TrieLookupOreo       299851 ns       295696 ns         2378
TrieLookupS          584831 ns       576801 ns         1204

The results show that the legacy look up uses 8.3x more CPU time to
handle the number of mappings added through S, whereas the Trie lookup
uses less than 2x more CPU time, showing that the trie scales better
with added mappings.

Test: run this benchmark
Change-Id: I35c3aa4429f049e327a891f9cbe1901d8855d7ba
2020-09-02 16:12:21 +00:00
Treehugger Robot
57af5a7c73 Merge "Incorporate upstream's strptime %Z/%z support." am: 159bb3f86b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1417572

Change-Id: Ic00db40d010c75b2384796c19751226bec5519fd
2020-09-02 15:49:39 +00:00
Treehugger Robot
159bb3f86b Merge "Incorporate upstream's strptime %Z/%z support." 2020-09-02 12:17:11 +00:00
Elliott Hughes
d065c0489e Incorporate upstream's strptime %Z/%z support.
I made toybox use strptime %Z recently (so that it can parse the default
POSIX date(1) output), forgetting that bionic's strptime(3) doesn't
support %Z. Neither does glibc, for that matter; the toybox change works
on glibc effectively by accident --- glibc just ignores the next word
when parsing %Z and assumes that the current time zone ($TZ) is
appropriate. Which it is for the only obvious use case of "round trip
date(1) output".

The related %z is potentially quite a bit more useful in general (parsing
any valid RFC822 time zone), though sadly not useful for the toybox case
that prompted.

Every time I touch this file I promise that I'll actually get us back in
sync with upstream, and every time I fail to get round to it. Maybe
2020 or 2021 will finally be the year...

Also add corresponding tests.

Bug: https://b/167455975
Test: treehugger
Change-Id: I13a7fb7e3ad01ae855750b9314d2eec661fe034f
2020-09-01 19:11:28 -07:00
Josh Gao
f5493e8ec9 Merge "Add fdtrack docs." am: 984b4e9ae1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1416649

Change-Id: I462a904a9851d1c6e9a699b49e42713141e697f7
2020-09-01 22:41:14 +00:00
Josh Gao
984b4e9ae1 Merge "Add fdtrack docs." 2020-09-01 21:51:31 +00:00
Josh Gao
12a0eb6c6d Add fdtrack docs.
Test: none
Change-Id: I035be350cfd40cdbff1e95332f96841001922454
2020-08-31 19:12:46 -07:00
Xin Li
7a265e76f2 Mark Android R (rvc-dev-plus-aosp-without-vendor@6692709) as merged
Bug: 166295507
Merged-In: I456220a914c602b5fc6b88dccf8dcfbcae0a3f8c
Change-Id: I19d39d36d7bcbf212b2b6c22f979231e1a349da5
2020-08-27 09:44:04 -07:00
Vy Nguyen
7aad6a87b2 Merge "Updated __libc_get_static_tls_bounds test to be more meaningful" am: f3c1b60d53
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1409507

Change-Id: I39c9fa3cae00612732692e84d6f6ff2a8885cccd
2020-08-27 04:59:55 +00:00
Vy Nguyen
f3c1b60d53 Merge "Updated __libc_get_static_tls_bounds test to be more meaningful" 2020-08-27 04:07:34 +00:00
Vy Nguyen
97ba12b972 Updated __libc_get_static_tls_bounds test to be more meaningful
Change-Id: I20b8716affd35f940f607d92f761736fba0a66fd
2020-08-26 21:34:28 -04:00
Treehugger Robot
3459e3fffa Merge "bionic_systrace: moving global static variables" am: 37e112f60a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1408030

Change-Id: I0468e27337caf48cbec68b6d275fb828b5351bed
2020-08-25 03:45:04 +00:00
Treehugger Robot
37e112f60a Merge "bionic_systrace: moving global static variables" 2020-08-25 02:52:56 +00:00
Bowgo Tsai
1e1c7845aa bionic_systrace: moving global static variables
Some global static variables are only used within a single function,
so moving them inside the function which requires them. This also
ensures those static variables of class types are initialized before
they are being used.

For example, this is needed for CachedProperty(), as some of the
member method, e.g., CachedProperty().Get(), might be invoked,
e.g., in __libc_preinit(), before the constructor is invoked.
This happens after we added property trace points in commit
Id2b93acb2ce02b308c0e4889f836159151af3b46.

For g_lock, we don't move them because it can be initialized by setting
its memory to 0. And it's used in two functions.
  https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/private/bionic_lock.h

Bug: 147275573
Test: atest CtsBionicTestCases
Test: adb shell perfetto -o /data/misc/perfetto-traces/test_trace -t 10s bionic sysprop
Change-Id: I99565ce2442d34f33830778915c737eed834f8b3
2020-08-25 02:26:30 +00:00
Josh Gao
2206289fe6 Merge "async_safe: don't call libc's socket." am: 1e0d28b9c2
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1406411

Change-Id: I11b3694cf294406f7badbd08a8d758eb86351f74
2020-08-21 23:54:26 +00:00
Josh Gao
1e0d28b9c2 Merge "async_safe: don't call libc's socket." 2020-08-21 23:34:20 +00:00
Treehugger Robot
ece7a0fe80 Merge "Fix issues with .note.GNU-stack section directives." am: 3d59029a12
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1406329

Change-Id: I36b63b49f50131af0ce0b42e4fd20f27752aca79
2020-08-21 21:39:20 +00:00
Josh Gao
d37113311c async_safe: don't call libc's socket.
Like with close, socket is no longer a simple syscall, so we can get
recursive calls that deadlock.

Bug: http://b/165206592
Test: bionic-unit-tests on cuttlefish
Test: treehugger
Change-Id: I2ba77d733d1ebf08a91afd6ca179e7ae6ae3866e
2020-08-21 14:23:57 -07:00
Treehugger Robot
3d59029a12 Merge "Fix issues with .note.GNU-stack section directives." 2020-08-21 21:22:14 +00:00
Stephen Hines
c68ec152d1 Fix issues with .note.GNU-stack section directives.
bionic/libm/x86_64/s_log1p.S:809:2: error: changed section type for .note.GNU-stack, expected: 0x1
 .section .note.GNU-stack, ""
 ^

These assembly sources are missing @progbits to set the section flags
correctly. Without it, they end up denoting a different section type. By
adding the @progbits explicitly, we see the same section flags with
readelf.

[ 4] .note.GNU-stack   PROGBITS        0000000000000000 000593 000000 00      0   0  1

Bug: http://b/155835175
Test: m for aosp_x86_64
Change-Id: Ifff35d35f5f9ded5938e88677b18805809820e9f
2020-08-21 12:17:12 -07:00
Treehugger Robot
0b27445a7e Merge "Adding system property tracing" am: 08bcaac208
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1403568

Change-Id: Ia80359428c9faeada5a496e15156af775dac3bc2
2020-08-21 10:06:13 +00:00