Commit graph

42541 commits

Author SHA1 Message Date
Automerger Merge Worker
833af7d046 Merge changes from topic "am-fc39bf82459e40b39b51f43b8ff8b420" into main
* changes:
  Merge "[RESTRICT AUTOMERGE] fcntl_F_SETFD test: allow both Android 14 and 2024Q1 behavior." into android14-tests-dev am: 74c359277a
  [automerger skipped] [RESTRICT AUTOMERGE] fcntl_F_SETFD test: allow both Android 14 and 2024Q1 behavior. am: 7922ce0d0d -s ours
2024-01-09 15:46:11 +00:00
Elliott Hughes
6e09723a89 Merge "[RESTRICT AUTOMERGE] fcntl_F_SETFD test: allow both Android 14 and 2024Q1 behavior." into android14-tests-dev am: 74c359277a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2898796

Change-Id: Ifc5ac6b4f7287d5284ded000f0fb9620df97af14
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 15:46:06 +00:00
Elliott Hughes
25860b0df4 [automerger skipped] [RESTRICT AUTOMERGE] fcntl_F_SETFD test: allow both Android 14 and 2024Q1 behavior. am: 7922ce0d0d -s ours
am skip reason: skipped by enh

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2898796

Change-Id: I37f86f60122e88b082a1865aa70c6b03a28a3dd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 15:46:05 +00:00
Automerger Merge Worker
5aafa76147 Merge "Merge "time.mktime_EOVERFLOW: set an explicit timezone." into android14-tests-dev am: d1afadc227" into main am: 3f7cd8db4d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2899271

Change-Id: Ic8301ec455e5c9f86e85683a0760dbb680d4894b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 15:44:41 +00:00
Automerger Merge Worker
62d990e42d Merge changes from topic "am-6e49f3db6dd44f3ba4b8bd688225b20a" into main
* changes:
  Merge "[RESTRICT AUTOMERGE] uchar/wchar tests: allow both Android 14 and 2024Q1 behaviors." into android14-tests-dev am: 82decc79bf
  [automerger skipped] [RESTRICT AUTOMERGE] uchar/wchar tests: allow both Android 14 and 2024Q1 behaviors. am: 30fc7dee98 -s ours
2024-01-09 15:29:31 +00:00
Elliott Hughes
1c47be4fce Merge "[RESTRICT AUTOMERGE] uchar/wchar tests: allow both Android 14 and 2024Q1 behaviors." into android14-tests-dev am: 82decc79bf
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2898797

Change-Id: Idb021fdd5be21dfe599079596b277177ce58ef3a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 15:29:26 +00:00
Elliott Hughes
d35135e270 [automerger skipped] [RESTRICT AUTOMERGE] uchar/wchar tests: allow both Android 14 and 2024Q1 behaviors. am: 30fc7dee98 -s ours
am skip reason: skipped by enh

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2898797

Change-Id: I421097c6740d63d9fa95866809d59402f33fb722
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 15:29:24 +00:00
Automerger Merge Worker
3f7cd8db4d Merge "Merge "time.mktime_EOVERFLOW: set an explicit timezone." into android14-tests-dev am: d1afadc227" into main 2024-01-09 15:13:21 +00:00
Elliott Hughes
dc77d4e73b Merge "time.mktime_EOVERFLOW: set an explicit timezone." into android14-tests-dev am: d1afadc227
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2899271

Change-Id: I23db475e85c85c564217edfb6a4e90a2e3804af1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 15:13:16 +00:00
Elliott Hughes
74c359277a Merge "[RESTRICT AUTOMERGE] fcntl_F_SETFD test: allow both Android 14 and 2024Q1 behavior." into android14-tests-dev 2024-01-09 14:39:00 +00:00
Elliott Hughes
82decc79bf Merge "[RESTRICT AUTOMERGE] uchar/wchar tests: allow both Android 14 and 2024Q1 behaviors." into android14-tests-dev 2024-01-09 14:38:47 +00:00
Elliott Hughes
d1afadc227 Merge "time.mktime_EOVERFLOW: set an explicit timezone." into android14-tests-dev 2024-01-09 14:38:33 +00:00
Ryan Prichard
72507e4ed5 WriteProtected: std::atomic<T> is no longer POD
std::atomic<T>'s default constructor is no longer trivial, because it
now does value-initialization. As a result, the class is no longer
trivial, so libc_globals is no longer trivial, so it is no longer POD.
(FWIW, the "POD" notion has been deprecated in favor of "trivial" and
"standard layout" concepts: POD == trivial + stdlayout.)

See https://cplusplus.github.io/LWG/issue2334 and wg21.link/p0883r2.

Mark __libc_globals as constinit, because that seems closer to
something we actually care about, AFAICT.

Bug: http://b/175635923
Test: m libc_malloc_debug
Change-Id: I338589bce03d06f20752bca342eeb86a42fc1ee7
2024-01-08 15:17:35 -08:00
Elliott Hughes
7922ce0d0d [RESTRICT AUTOMERGE] fcntl_F_SETFD test: allow both Android 14 and 2024Q1 behavior.
What's important is that we name the flag. It doesn't really matter
whether you have the better message that will be in Android 15. As long
as 2024Q1 is using Android 14's CTS, Android 14's CTS needs to work with
both.

Bug: http://b/307680874
Test: treehugger
Change-Id: I8c50707e1dfd6b40e6ced887ae105508c6339989
2024-01-06 00:28:41 +00:00
Elliott Hughes
30fc7dee98 [RESTRICT AUTOMERGE] uchar/wchar tests: allow both Android 14 and 2024Q1 behaviors.
As long as 2024Q1 is using Android 14's CTS, Android 14's CTS needs
to work with both. That doesn't really seem practical for these tests,
so just disable them.

Bug: http://b/307680874
Test: treehugger
Change-Id: Iab4085ce1be1b0e00a6714eaf3008787e29e7e7b
2024-01-06 00:26:26 +00:00
Elliott Hughes
db123a73ca time.mktime_EOVERFLOW: set an explicit timezone.
Bug: http://b/283397453 (original)
Bug: http://b/307680874 (cherrypick)
Test: export TZ=Asia/Shanghai
Change-Id: Ia03822adad367abf35a0fdf55d7367cd1764fcdd
(cherry picked from commit f52b2165cb)
2024-01-06 00:19:03 +00:00
Elliott Hughes
be767e39bf Merge "Remove a few glibc #if hacks." into main am: 6717b2d3e6
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2897675

Change-Id: Ic88624af4897947119d7d5d1c1372b7961c81a66
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-05 19:56:09 +00:00
Elliott Hughes
6717b2d3e6 Merge "Remove a few glibc #if hacks." into main 2024-01-05 19:15:25 +00:00
Treehugger Robot
36e5cbda7f Merge "Make apex availability of some bionic libraries explicit" into main am: 343381d593
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2898302

Change-Id: I5dcda53c5231053ebe827cfc049a7d2a140dc862
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-05 01:27:06 +00:00
Elliott Hughes
2ddb20d29d Remove a few glibc #if hacks.
We've updated the corresponding glibc headers so we don't need these
hacks any more.

Bug: http://b/318541070
Test: treehugger
Change-Id: Ic1974f30f9edb2589cc93041822706bc89909882
2024-01-04 16:44:57 -08:00
Treehugger Robot
343381d593 Merge "Make apex availability of some bionic libraries explicit" into main 2024-01-05 00:32:10 +00:00
Dennis Shen
f56f1c6794 Merge "Revert "system properties: doubling the shared file size to 256Kb"" into main am: c1e79efa0a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2898001

Change-Id: If37d4cf2dd4bc8d6018a4c99d8db37c587eb2f2a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-04 21:55:21 +00:00
Dennis Shen
c1e79efa0a Merge "Revert "system properties: doubling the shared file size to 256Kb"" into main 2024-01-04 21:24:20 +00:00
Spandan Das
0a6cfe992e Make apex availability of some bionic libraries explicit
The libraries are
- libdl_static
- liblinker_main
- liblinker_malloc
- libsystemproperties

The availability to runtime apex was done implicitly using a baseline map in
build/soong/apex/apex.go. Make this explicit in Android.bp

Bug: 281077552
Test: m nothing
Change-Id: I029ae204f6cfef8c301a20b7c4294636b60b38be
2024-01-04 18:14:44 +00:00
Dennis Shen
3d1ce8c831 Revert "system properties: doubling the shared file size to 256Kb"
This reverts commit 46cce48995.

Reason for revert: 

Will put a change behind flags to bump storage to 1Mb for internal build only. AOSP code does not need to be changed. The change will be only made to git_main.

Change-Id: If3484d0e56f4c3d8fc729f55744c2d8ebdd13b11
2024-01-04 14:18:38 +00:00
Treehugger Robot
e717251be9 Merge "riscv64: remove some obsolete #if cruft." into main am: df0b557e09
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2896304

Change-Id: I53353a8e4a4fa93f6daf6afcf31b3802e29067f3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-03 21:12:34 +00:00
Treehugger Robot
df0b557e09 Merge "riscv64: remove some obsolete #if cruft." into main 2024-01-03 20:47:42 +00:00
Elliott Hughes
3ef682790e riscv64: remove some obsolete #if cruft.
We have newer uapi headers now.

Test: treehugger
Change-Id: Ic5d602f3a97a860ee9f1ad5b791b46013f25e743
2024-01-03 12:08:51 -08:00
Elliott Hughes
cd42be98ae Merge "Microoptimize the strtol() family." into main am: 4fe4f10069
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2871135

Change-Id: Iea9f488923783b8020ecd3cb87fb88e77514a16a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-02 21:48:41 +00:00
Elliott Hughes
4fe4f10069 Merge "Microoptimize the strtol() family." into main 2024-01-02 21:26:41 +00:00
Dennis Shen
37f741a7d4 Merge "system properties: doubling the shared file size to 256Kb" into main am: b28d496c18
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2874874

Change-Id: Id84287cb6c7c6c24b4c4f5118ccded19666ca511
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-18 17:05:34 +00:00
Dennis Shen
b28d496c18 Merge "system properties: doubling the shared file size to 256Kb" into main 2023-12-18 16:40:27 +00:00
Dennis Shen
46cce48995 system properties: doubling the shared file size to 256Kb
While aconfig flag storage is being migrated to its own dedicated
storage, we need to provide some relief to the current flag users which
are running into storage capacity limit of system property. Currently
system property by default allocates a file of 128Kb for each storage
node. Bump it to 256Kb for now.

Bug: b/316037066
Change-Id: I8b0b58733f362c3789ec92ae09ee589c7c1b72c6
2023-12-18 14:02:21 +00:00
Andy Hung
6f3ca33f88 Merge "bionic: fix pthread_mutex_timedlock for PI mutexes" into main am: 46f0ddb29f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2869605

Change-Id: I7c643ae14c0235f47a81d5729e8e6db20e88456a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 18:29:46 +00:00
Andy Hung
46f0ddb29f Merge "bionic: fix pthread_mutex_timedlock for PI mutexes" into main 2023-12-14 17:52:55 +00:00
Elliott Hughes
b44804c2b0 Merge "-fno-emulated-tls is the default now." into main am: f6358c9126
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2874456

Change-Id: Ia15e5ff39edc786ce042af2cec6cb6e79f3d7941
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 16:53:14 +00:00
Elliott Hughes
f6358c9126 Merge "-fno-emulated-tls is the default now." into main 2023-12-14 16:25:22 +00:00
Elliott Hughes
93e75ac33c -fno-emulated-tls is the default now.
bionic doesn't target old api levels.

Test: treehugger
Change-Id: I3534dd3fd34b9130fd5500dbd6a3a314081e9036
2023-12-13 16:03:25 -08:00
Andy Hung
5e19b185fd bionic: fix pthread_mutex_timedlock for PI mutexes
FUTEX_LOCK_PI uses CLOCK_REALTIME so adjust clock timebase
accordingly.

FUTEX_WAIT_BITSET, FUTEX_WAIT_REQUEUE_PI, FUTEX_LOCK_PI2
are updated to check the presence of FUTEX_CLOCK_REALTIME flag.

Test: atest bionic-unit-tests
Bug: 312787238
Bug: 315897315
Change-Id: I2d93286cf22d3b3d9f3757d49b46f7ee9ea5490c
2023-12-13 12:10:50 -08:00
Elliott Hughes
ca89b33108 Microoptimize the strtol() family.
The main change here is to remember that we arm64/x86-64 have flags, and
__builtin_<op>_overflow() lets us look at them. There's a clear saving
for arm64, and x86-64 is better too, though interestingly there the
unsigned case doesn't work out as well as the signed case because both
unsigned __builtin_mul_overflow and unsigned __builtin_add_overflow are
less efficient than the signed multiply and subtract on that
architecture, but the new code still beats the old code even so.

There's a very tiny microoptimization of the hex path that takes
advantage of the fact that conversion to lowercase is a single
instruction on all our architectures when we already know we're dealing
with a letter.

This also merges the signed and unsigned variants of the code. Not
entirely successfully, but the vast majority of the code benefits.

Before (arm64):
```
----------------------------------------------------------------
Benchmark                      Time             CPU   Iterations
----------------------------------------------------------------
BM_inttypes_strtoimax       44.6 ns         44.3 ns     15807654
BM_inttypes_strtoumax       43.1 ns         42.8 ns     16348848
BM_stdlib_strtol            44.6 ns         44.3 ns     15805384
BM_stdlib_strtol_hex        85.5 ns         85.0 ns      8235487
BM_stdlib_strtoll           44.5 ns         44.2 ns     15833137
BM_stdlib_strtoul           43.1 ns         42.8 ns     16353963
BM_stdlib_strtoul_hex       83.1 ns         82.6 ns      8477732
BM_stdlib_strtoull          43.1 ns         42.8 ns     16353015
```

After (arm64):
```
----------------------------------------------------------------
Benchmark                      Time             CPU   Iterations
----------------------------------------------------------------
BM_inttypes_strtoimax       37.9 ns         37.6 ns     17657577
BM_inttypes_strtoumax       35.9 ns         35.7 ns     19597727
BM_stdlib_strtol            36.9 ns         36.7 ns     19093037
BM_stdlib_strtol_hex        70.7 ns         70.3 ns      9961626
BM_stdlib_strtoll           36.9 ns         36.7 ns     19093032
BM_stdlib_strtoul           35.9 ns         35.7 ns     19617784
BM_stdlib_strtoul_hex       67.7 ns         67.3 ns     10113521
BM_stdlib_strtoull          35.9 ns         35.7 ns     19621828
```

Test: treehugger
Change-Id: Ibf53b29e34d63ac31520c6d27ef80ff281899d61
2023-12-13 10:46:42 -08:00
Treehugger Robot
16f36f1c0e Merge "Reserve TLS slot for native bridge" into main am: 0144257234 am: 907d4dcae4 am: 83b9c92266
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2824791

Change-Id: I31fa4dbcd97272ab12eada1d358b05f6228aff16
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 17:32:16 +00:00
Elliott Hughes
94c2369f4a Merge "Microoptimize vdso lookup." into main am: 18a6fa2d2f am: ad27b8618e am: e4ceb066c3
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2871814

Change-Id: Ia737938236828928f5a88a1e9cfd21b16265386f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 17:30:41 +00:00
Treehugger Robot
83b9c92266 Merge "Reserve TLS slot for native bridge" into main am: 0144257234 am: 907d4dcae4
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2824791

Change-Id: Ie0925e3edb4f48ee23cd122a482ba251e02137db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 16:59:52 +00:00
Elliott Hughes
e4ceb066c3 Merge "Microoptimize vdso lookup." into main am: 18a6fa2d2f am: ad27b8618e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2871814

Change-Id: I81430554df6f1a3d511943e03bc06ee6a5b7f439
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 16:59:39 +00:00
Treehugger Robot
907d4dcae4 Merge "Reserve TLS slot for native bridge" into main am: 0144257234
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2824791

Change-Id: If6f6e9f6a61b4c85baa631a3f82cd389dccf42d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 16:13:19 +00:00
Elliott Hughes
ad27b8618e Merge "Microoptimize vdso lookup." into main am: 18a6fa2d2f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2871814

Change-Id: I661c136e478f485f5ce8a1564964352d48605dac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 16:13:08 +00:00
Treehugger Robot
0144257234 Merge "Reserve TLS slot for native bridge" into main 2023-12-13 16:07:49 +00:00
Elliott Hughes
18a6fa2d2f Merge "Microoptimize vdso lookup." into main 2023-12-13 15:46:32 +00:00
Elliott Hughes
cbcccd53eb Microoptimize vdso lookup.
Actually reusing the hash table stuff from the linker would be a lot of
work (and the benefit unclear for so few symbols), but we can at least
break out of loops as soon as we have what we need.

Test: treehugger
Change-Id: I9cbe4636a3e3163bd302c3676eb674a4278dbf2e
2023-12-12 15:13:03 -08:00
Elliott Hughes
4de849bd44 Merge "Closing the stream when the function returns" into main am: 14b322b251 am: dd9d3cd9a0 am: a7f8f36394
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2856549

Change-Id: I88db8520f2db892f369ded5160b2beeffad5ecd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-12 18:08:13 +00:00