Commit graph

41326 commits

Author SHA1 Message Date
Ryan Prichard
45884037fe Merge "Avoid printing char16_t* and wchar_t to gtest Message" into main 2024-01-10 22:02:02 +00:00
Ryan Prichard
f40f25829e Avoid printing char16_t* and wchar_t to gtest Message
gtest's Message class has a special handler for operator<< of wchar_t*
to convert it to UTF-8, but it doesn't have one for a single wchar_t or
for a char16_t* string. It delegates these to std::stringstream, which
as of a libc++ upgrade, deletes its operator<< for char16_t and
wchar_t. See wg21.link/p1423r3.

Bug: http://b/175635923
Test: m MODULES-IN-bionic
Change-Id: I8307663b72855cfc0b91d7f63993f1f6fe028b8e
2024-01-10 10:30:02 -08:00
Treehugger Robot
a4d60ad5a2 Merge "Clarify what's in the upstream- directories..." into main 2024-01-10 01:41:32 +00:00
Elliott Hughes
7468ac257a Clarify what's in the upstream- directories...
...and how they got that way.

Test: treehugger
Change-Id: I07e2881781224f9b698008bd165b28a89b620dac
2024-01-10 00:25:30 +00:00
Ryan Prichard
67d1705618 Merge "WriteProtected: std::atomic<T> is no longer POD" into main 2024-01-09 19:46:44 +00:00
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
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
6717b2d3e6 Merge "Remove a few glibc #if hacks." into main 2024-01-05 19:15:25 +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
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
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
4fe4f10069 Merge "Microoptimize the strtol() family." into main 2024-01-02 21:26:41 +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
46f0ddb29f Merge "bionic: fix pthread_mutex_timedlock for PI mutexes" into main 2023-12-14 17:52:55 +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
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
14b322b251 Merge "Closing the stream when the function returns" into main 2023-12-12 16:39:01 +00:00
Elliott Hughes
00ab1a5f95 Merge "Add a missing strtol() family test and a hex benchmark." into main 2023-12-12 14:27:30 +00:00
Elliott Hughes
4e62055462 Add a missing strtol() family test and a hex benchmark.
Benchmark added to test an optimization I'll send round next, test added
when an even bigger refactoring (as part of a more interesting
optimization) broke strtol() in a way the strtol() tests didn't notice.

Test: treehugger
Change-Id: Ic974900021107938dbbbe98648960adb102d9595
2023-12-11 16:57:03 -08:00
Florian Mayer
7fdb49f129 Merge "Plumb scudo_stack_depot_size to debuggerd_process_info" into main 2023-12-11 23:38:13 +00:00
Colin Cross
0ce2dcfad2 Merge "Remove bionic bp2build properties" into main 2023-12-11 23:12:54 +00:00
Yi Kong
20e2b13041 Merge "Re-enable LTO for libdl_android" into main 2023-12-11 15:58:13 +00:00
Yi Kong
bbd9c0e275 Re-enable LTO for libdl_android
The build breakage is now fixed by the current stable Clang, workaround
is no longer needed.

Test: presubmit
Bug: 169004486
Change-Id: Ieb1e35b0dbafe0fbe47c23ff310c803bf697a664
2023-12-11 16:06:02 +09:00
Juan Yescas
717debf261 Merge "16k: Fix sysconf_SC_ARG_MAX test to support 16k page sizes" into main 2023-12-08 21:01:54 +00:00
Elliott Hughes
4fa4354799 Merge "Remove obsolete workaround." into main 2023-12-08 19:56:42 +00:00
Juan Yescas
2da31cf7b0 16k: Fix sysconf_SC_ARG_MAX test to support 16k page sizes
The sysconf_SC_ARG_MAX test was failing because it didn't
handle the case for 16k. After fixing the test case, it will
handle 4k/16k page sizes and fail when there is another page
size.

Bug: 315174209
Test: atest -c bionic-unit-tests-static
Change-Id: Ie24a79be9d6790a1243be48d39f67acda485c37d
2023-12-08 11:51:39 -08:00
Juan Yescas
42e65898fe Merge "16k: Fix pthread tests to support 4k/16k page sizes" into main am: 837e4d1f52
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2863353

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