Commit graph

41439 commits

Author SHA1 Message Date
Automerger Merge Worker
345aa1e903 Merge changes from topic "am-1324cc5267bd42bf80b925722de582b5" into main
* changes:
  Merge "[RESTRICT AUTOMERGE] time_test#mktime_EOVERFLOW: allow both Android 14 and 2024Q1 behavior." into android14-tests-dev am: c2a27bd25a
  [RESTRICT AUTOMERGE] time_test#mktime_EOVERFLOW: allow both Android 14 and 2024Q1 behavior. am: 4c5eeb8346
2024-01-12 22:47:30 +00:00
Treehugger Robot
c400c439e3 Merge "[RESTRICT AUTOMERGE] time_test#mktime_EOVERFLOW: allow both Android 14 and 2024Q1 behavior." into android14-tests-dev am: c2a27bd25a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2908740

Change-Id: I484c3b10bd052c53e2cb670685e70870b876c87b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-12 22:47:25 +00:00
Elliott Hughes
1c116ba64a [RESTRICT AUTOMERGE] time_test#mktime_EOVERFLOW: allow both Android 14 and 2024Q1 behavior. am: 4c5eeb8346
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2908740

Change-Id: Ib623cf4b4dda4791b0647b7c6d93543389431e30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-12 22:47:23 +00:00
Kalesh Singh
f5146642e1 Merge "bionic: Add crt_pad_segment" into main 2024-01-12 22:23:08 +00:00
Treehugger Robot
c2a27bd25a Merge "[RESTRICT AUTOMERGE] time_test#mktime_EOVERFLOW: allow both Android 14 and 2024Q1 behavior." into android14-tests-dev 2024-01-12 22:22:42 +00:00
Elliott Hughes
4c5eeb8346 [RESTRICT AUTOMERGE] time_test#mktime_EOVERFLOW: allow both Android 14 and 2024Q1 behavior.
As long as 2024Q1 is using Android 14's CTS, Android 14's CTS needs to
work with both. That doesn't make much sense for this test of a bug fix,
so just disable it.

Bug: http://b/307680874
Test: treehugger
Change-Id: Ic1bea5d0404c91279a025ac97b521f07e4d2d387
2024-01-12 19:52:55 +00:00
Kalesh Singh
862a23dfdf bionic: Add crt_pad_segment
crt_pad_segment provides a note of type NT_ANDROID_TYPE_PAD_SEGMENT.
It's intended when present is for the loader to pad segment gaps to
reduce kernel slab memory usage (due to additional vm_area_struct's
for gaps). crt_pad_segment.o retains control to the static linker so
that app developers can opt out (build with different flags) it there
are undesireable side effects.

Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000 000000 00      0   0  0
  [ 1] .strtab           STRTAB          0000000000000000 0000f8 000066 00      0   0  1
  [ 2] .text             PROGBITS        0000000000000000 000040 000000 00  AX  0   0  4
  [ 3] .note.GNU-stack   PROGBITS        0000000000000000 000040 000000 00      0   0  1
  [ 4] .note.android.pad_segment NOTE            0000000000000000 000040 00001c 00   A  0   0  4
  [ 5] .rela.note.android.pad_segment RELA            0000000000000000 0000e0 000018 18   I  7   4  8
  [ 6] .debug_line       PROGBITS        0000000000000000 00005c 000052 00      0   0  1
  [ 7] .symtab           SYMTAB          0000000000000000 0000b0 000030 18      1   1  8
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  D (mbind), l (large), p (processor specific)

Bug: 316403210
Test: m -j50 ndk
Test: find out/soong/ndk -name 'crt_pad_segment.o'
Test: readelf -SW crt_pag_segment.o
Change-Id: I94af5e85fd602e7ba5fd56788ae39277368229d8
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-01-12 10:22:08 -08:00
Elliott Hughes
f71f6cfea7 Merge "sys_statvfs_test: fix expectation for Linux 6.7." into main 2024-01-12 17:22:47 +00:00
Treehugger Robot
e8cb7875d2 Merge "Give a bit more background on "uapi headers"." into main 2024-01-11 21:14:03 +00:00
Elliott Hughes
7506c37386 sys_statvfs_test: fix expectation for Linux 6.7.
I'd assumed that it was _deliberate_ that filesystems like procfs
reported 0 here, but apparently not. Good news: this makes for a more
worthwhile test than we had previously (at least when run on a 6.7+
kernel).

Bug: http://b/319590754
Test: treehugger
Change-Id: I0a63faa8ca359592a29d7bca1a40ecd94fd50044
2024-01-11 20:46:23 +00:00
Elliott Hughes
cfc3090868 Give a bit more background on "uapi headers".
Not everyone knows what these are, and we don't otherwise explain it.

Test: N/A
Change-Id: Ic28e4fd0f8584f5e808ab60f0c2e68dd0cf30088
2024-01-11 00:09:25 +00:00
Christopher Ferris
4cfb2bde90 Merge "Update mmap benchmarks and add madvise bechmarks." into main 2024-01-10 22:30:18 +00:00
Ryan Prichard
45884037fe Merge "Avoid printing char16_t* and wchar_t to gtest Message" into main 2024-01-10 22:02:02 +00:00
Christopher Ferris
3e281b1dcb Update mmap benchmarks and add madvise bechmarks.
A small refactor of the mmap benchmarks to make it easier to benchmark
the mmap and munmap separately. Add a mmap only and munmap only benchmark.

Add new madvise benchmarks.

Clean-up fixed mmap benchmarks to properly create the initial map.

Test: Ran benchmarks on host and on device.
Change-Id: I2fc306dd3eba151cff066da8df8f0168df0ade69
2024-01-10 12:57:45 -08: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