Commit graph

40144 commits

Author SHA1 Message Date
Elliott Hughes
63043c04ad Merge "riscv64: add <sys/hwprobe.h>." into main am: c4d3867b6c am: 98f649e224
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2679530

Change-Id: I96098f18a8f61cacd803311c2d233faac8bf58c1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-29 01:35:45 +00:00
Elliott Hughes
98f649e224 Merge "riscv64: add <sys/hwprobe.h>." into main am: c4d3867b6c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2679530

Change-Id: I0edb9396e8a1db6f8cd64e21bad0f59af25d6315
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-29 00:54:07 +00:00
Elliott Hughes
c4d3867b6c Merge "riscv64: add <sys/hwprobe.h>." into main 2023-07-28 23:53:15 +00:00
Florian Mayer
8fc5ab4f72 Don't assume size of functions.
Bug: 293532332
Change-Id: I93a8c5380b17b77ff85f4027b48ea5318a03e9e3
2023-07-28 15:51:38 -07:00
Elliott Hughes
f3d6b44e2b riscv64: add <sys/hwprobe.h>.
This is source compatible with the current proposal for glibc.

Bug: https://github.com/google/android-riscv64/issues/27
Test: treehugger
Change-Id: I428777e4eac1fe643d442a93a4b3ad1fdf0ffd97
2023-07-28 09:29:06 -07:00
Elliott Hughes
7c95495ead avx2 memset: add missing vzeroupper.
Also improve a few labels. This actually improves performance slightly,
and removes the weird behavior I was seeing around 512 bytes in the
"before" numbers...

Before:
```
BM_string_memset/8/0            2.12 ns         2.12 ns    332002763 bytes_per_second=3.52172G/s
BM_string_memset/16/0           2.36 ns         2.36 ns    297459840 bytes_per_second=6.31618G/s
BM_string_memset/32/0           2.36 ns         2.36 ns    296996995 bytes_per_second=12.6321G/s
BM_string_memset/64/0           2.37 ns         2.36 ns    296196644 bytes_per_second=25.2097G/s
BM_string_memset/512/0          65.9 ns         65.8 ns     10609200 bytes_per_second=7.24172G/s
BM_string_memset/1024/0         69.5 ns         69.5 ns     10079176 bytes_per_second=13.7312G/s
BM_string_memset/8192/0          123 ns          123 ns      5726682 bytes_per_second=62.2494G/s
BM_string_memset/16384/0         183 ns          183 ns      3832127 bytes_per_second=83.5219G/s
BM_string_memset/32768/0         306 ns          306 ns      2292654 bytes_per_second=99.8293G/s
BM_string_memset/65536/0         570 ns          569 ns      1224926 bytes_per_second=107.185G/s
BM_string_memset/131072/0       1067 ns         1067 ns       654098 bytes_per_second=114.395G/s
```

After:
```
BM_string_memset/8/0            2.34 ns         2.34 ns    299919615 bytes_per_second=3.18993G/s
BM_string_memset/16/0           2.58 ns         2.58 ns    271170449 bytes_per_second=5.76711G/s
BM_string_memset/32/0           2.61 ns         2.61 ns    266003840 bytes_per_second=11.4245G/s
BM_string_memset/64/0           2.62 ns         2.62 ns    269191710 bytes_per_second=22.784G/s
BM_string_memset/128/0          2.84 ns         2.84 ns    244486639 bytes_per_second=41.994G/s
BM_string_memset/256/0          4.23 ns         4.23 ns    165575532 bytes_per_second=56.4047G/s
BM_string_memset/512/0          7.12 ns         7.12 ns     99398933 bytes_per_second=67.0164G/s
BM_string_memset/1024/0         10.9 ns         10.9 ns     64108888 bytes_per_second=87.2884G/s
BM_string_memset/8192/0         63.6 ns         63.6 ns     11012138 bytes_per_second=119.989G/s
BM_string_memset/16384/0         127 ns          127 ns      5506888 bytes_per_second=120.065G/s
BM_string_memset/32768/0         252 ns          251 ns      2783524 bytes_per_second=121.346G/s
BM_string_memset/65536/0         515 ns          515 ns      1357500 bytes_per_second=118.587G/s
BM_string_memset/131072/0       1013 ns         1012 ns       691605 bytes_per_second=120.587G/s
```

Bug: http://b/292281479
Test: treehugger
Change-Id: I45bfffedbdf0ec55a1b1341ffbab0af6d240d3a3
2023-07-27 14:23:17 -07:00
Ryan Prichard
e18f5ec398 Merge "Hold the loader mutex in linker_main once constructors are running" into main am: 6e601911f1 am: bf1e5f83ad
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2670169

Change-Id: If20c2bea4892eec1d3b5303b8319660265c956d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-26 05:08:57 +00:00
Ryan Prichard
bf1e5f83ad Merge "Hold the loader mutex in linker_main once constructors are running" into main am: 6e601911f1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2670169

Change-Id: I07b3304620d440273728a8474f4aa9cc22c4aa5b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-26 04:25:18 +00:00
Ryan Prichard
6e601911f1 Merge "Hold the loader mutex in linker_main once constructors are running" into main 2023-07-26 03:19:12 +00:00
Ryan Prichard
1b58f5c94a Merge changes I9c181568,Ic0b08511 into main am: 504590d1e2 am: 96465a7b7c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2674457

Change-Id: Ieab9046fb2e0962a708b34d54251d6cac195067a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 21:05:00 +00:00
Christopher Ferris
21433531d4 Merge "No tombstones under normal bionic unit tests run." into main am: 78a74b02ad am: 2cafbeff4c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2673489

Change-Id: Ib1fa7e8d80dd3601148e5aad9900745f29df39bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 21:04:34 +00:00
Ryan Prichard
96465a7b7c Merge changes I9c181568,Ic0b08511 into main am: 504590d1e2
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2674457

Change-Id: I0ebea0830c30d73835d672973a83f1bd47e86bae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 20:38:03 +00:00
Ryan Prichard
504590d1e2 Merge changes I9c181568,Ic0b08511 into main
* changes:
  Add aligned_alloc to linker_memory.cpp
  Add missing assert.h include
2023-07-25 20:14:40 +00:00
Christopher Ferris
2cafbeff4c Merge "No tombstones under normal bionic unit tests run." into main am: 78a74b02ad
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2673489

Change-Id: If361212dda0c9601139c777ccd70a8ffbfd45248
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 20:03:00 +00:00
Christopher Ferris
78a74b02ad Merge "No tombstones under normal bionic unit tests run." into main 2023-07-25 19:24:42 +00:00
Christopher Ferris
7e44651686 Merge "Mark death tests properly." into main am: 1b42f8bfd6 am: 0800b98cd5
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2673483

Change-Id: I700cfe093de08be92ad7458bc8970f1d94b462e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 01:56:51 +00:00
Christopher Ferris
0800b98cd5 Merge "Mark death tests properly." into main am: 1b42f8bfd6
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2673483

Change-Id: I322e6fdb275c8c02e141cdabbbb9ccdc3c3be1b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 01:15:53 +00:00
Christopher Ferris
15c22cdee0 No tombstones under normal bionic unit tests run.
Change a test to use a signal that does not trigger a tombstone.

Also changed the gwp_asan_integration.DISABLED_assert_gwp_asan_enabled
test to inherit from the SilentDeathTest to prevent tombstones
being generated.

Test: Ran tests and no tombstones generated.
Change-Id: I0f104704829dde692aa515a63dea1c6971278c29
2023-07-24 17:51:41 -07:00
Christopher Ferris
1b42f8bfd6 Merge "Mark death tests properly." into main 2023-07-25 00:42:05 +00:00
Christopher Ferris
c833fabed7 Mark death tests properly.
A few death tests are not set to silence tombstones, so fix
all of those occurrences.

Test: Ran all death tests and no tombstones generated.
Change-Id: If2b54b1a3432edbd54076439d40527d966607f70
2023-07-24 14:31:15 -07:00
Ryan Prichard
18d856e54b Add aligned_alloc to linker_memory.cpp
The new libc++_static.a platform prebuilt prefers to use this C11
function rather than the non-standard memalign.

Bug: http://b/175635923
Test: treehugger
Change-Id: I9c181568ba69c0508e400baac2cbb42b169c9768
2023-07-24 13:08:34 -07:00
Ryan Prichard
3714f21137 Add missing assert.h include
Bug: http://b/175635923
Test: treehugger
Change-Id: Ic0b085116c21ac35720f0558b1ba0b57a41b0f84
2023-07-24 13:08:16 -07:00
Ryan Prichard
9a027c7236 Hold the loader mutex in linker_main once constructors are running
A constructor could spawn a thread, which could call into the loader,
so the global loader mutex must be held.

Bug: http://b/290318196
Test: treehugger
Change-Id: I7a5249898a11fbc62d1ecdb85b24017a42a4b179
2023-07-21 23:14:46 -07:00
Christopher Ferris
030484df41 Merge "Fix potential flakiness in android_mallopt test." into main am: 1b61cbf604 am: 8337f440d6
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2670163

Change-Id: Ifcdf49dc70213032610bbd635c0f5e2154c36ae1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-22 05:00:08 +00:00
Christopher Ferris
8337f440d6 Merge "Fix potential flakiness in android_mallopt test." into main am: 1b61cbf604
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2670163

Change-Id: I3d20fee57d94817f9bef5fda7551ac35b9c83655
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-22 04:18:21 +00:00
Christopher Ferris
1b61cbf604 Merge "Fix potential flakiness in android_mallopt test." into main 2023-07-22 03:28:39 +00:00
Christopher Ferris
fe13041d22 Fix potential flakiness in android_mallopt test.
The set_allocation_limit_multiple_threads test could fail every
once in a while. So rewrite slightly so that the tests wait until
all of the threads are running before letting them start.

I also refactored the code to use std::thread instead of the raw
pthread functions.

Bug: 291672185

Test: Ran the test thousdands of times.
Change-Id: Ia0bdef93d58e0ff8266e551ed4a32e14ff829581
2023-07-21 13:42:09 -07:00
Elliott Hughes
8003123e76 Merge "Reuse the libm scalbn() as ldexp()." into main am: 5684b722d9 am: 5b015b9e4a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2665999

Change-Id: I1294eb8eee6397ecf44865339834556c34036871
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-21 15:50:20 +00:00
Elliott Hughes
5b015b9e4a Merge "Reuse the libm scalbn() as ldexp()." into main am: 5684b722d9
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2665999

Change-Id: I8414e61266b196df7eeeb49246c8a0dee27d0a74
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-21 15:08:50 +00:00
Elliott Hughes
5684b722d9 Merge "Reuse the libm scalbn() as ldexp()." into main 2023-07-21 14:08:15 +00:00
Treehugger Robot
9a882a127a Merge "Disable uchar.start_state test for musl." into main am: 23f67fbb08 am: d00cd20112
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2667483

Change-Id: I1cdedb376388dc75eb76e85b40a4b7fe72e177e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-21 02:15:42 +00:00
Treehugger Robot
d00cd20112 Merge "Disable uchar.start_state test for musl." into main am: 23f67fbb08
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2667483

Change-Id: I5a7138af2d6ab06ab72d46df47c9037ead236f91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-21 01:33:26 +00:00
Treehugger Robot
23f67fbb08 Merge "Disable uchar.start_state test for musl." into main 2023-07-21 00:52:17 +00:00
Dan Albert
09d3b5065d Disable uchar.start_state test for musl.
These all appear to be either musl bugs or underspecified corners of
the C standard, so rather than verify the musl behavior I've just
disabled the body of the test for musl.

Now that this is skipped, all the uchar tests are passing for bionic,
glibc, and musl.

Bug: None
Test: None
Change-Id: Icf88ef42e9b750ab45ba76bf8112967b00e72a9f
2023-07-20 22:09:30 +00:00
Treehugger Robot
9f84d378d5 Merge "Add missing setlocale calls in tests." into main am: c1c39ca5a1 am: 695a411c79
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2667696

Change-Id: I2fc07ec7c20a567b4dbc8b250192265e10b70056
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 21:31:23 +00:00
Elliott Hughes
c204334b06 Reuse the libm scalbn() as ldexp().
These are the same function for machines with binary floats (that is:
all machines), but ldexp() is in libc rather than libm, so we can't just
use an alias.

We were using this duplicate copy of the code, but upstream FreeBSD has
removed it, and I'd prefer to do the same.

Longer term, we should just move all of libm into libc (but keep an
empty libm for compatibility), but this is probably easier for now.

Test: treehugger
Change-Id: I1a1d6d4f1771316f791ad59c714a3a65aedefc81
2023-07-20 21:05:44 +00:00
Treehugger Robot
695a411c79 Merge "Add missing setlocale calls in tests." into main am: c1c39ca5a1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2667696

Change-Id: I4936a5b7d781371ffdedd23f665ce1097497d163
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 20:44:20 +00:00
Treehugger Robot
c1c39ca5a1 Merge "Add missing setlocale calls in tests." into main 2023-07-20 20:02:33 +00:00
Treehugger Robot
cc1bc19e20 Merge "Fix another over-long UTF-8 sequence test." into main am: a8a9c09e0f am: 635c4db50f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2666455

Change-Id: I4533377fcbe2ae520d34992f7b662bd30c977f99
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 17:41:06 +00:00
Treehugger Robot
a9f95bac77 Merge changes I0845fdee,I879de1e8 into main am: 876f3668ac am: b23c473e32
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2665214

Change-Id: I683563c4c43e380e800bc80300eb1b5b30272542
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 17:40:54 +00:00
Elliott Hughes
e345b3f4a2 Merge "De-pessimize SigSetConverter usage." into main am: ab9028c8ba am: 75e41cca99
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2660920

Change-Id: If9c3603f456a6c912220fb708a05e8ec54654a86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 17:40:10 +00:00
Treehugger Robot
635c4db50f Merge "Fix another over-long UTF-8 sequence test." into main am: a8a9c09e0f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2666455

Change-Id: Icd681bf70a5f1f50e0551da934a34e17a934bd0e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 17:19:27 +00:00
Treehugger Robot
b23c473e32 Merge changes I0845fdee,I879de1e8 into main am: 876f3668ac
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2665214

Change-Id: I6aeb74c53540e9d4bf83dd2618c0a46188eb6fa7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 17:18:44 +00:00
Dan Albert
a0d0e350a5 Add missing setlocale calls in tests.
Doesn't do anything for bionic (which is why this has gone unnoticed),
but it does change the locale for glibc and musl. After this patch,
all these tests pass on glibc. musl is still failing in
uchar.start_state, which I haven't finished investigating.

This should probably be a test fixture so it's harder to forget, but
there are a handful of tests here which don't call setlocale until
part way through the tests, and I'm not certain if that was attempting
to test some non-obvious behavior, or if that was just an accident. I
don't want to change that test behavior before understanding it
better, so this will do for now.

Bug: None
Test: ./tests/run-on-host.sh 64 --gtest_filter="uchar.*"
Test: ./tests/run-on-host.sh glibc --gtest_filter="uchar.*"
Test: ./tests/run-on-host.sh musl --gtest_filter="uchar.*"
Change-Id: Ib781a41893f021e336e67281070932f41f792318
2023-07-20 17:15:59 +00:00
Treehugger Robot
a8a9c09e0f Merge "Fix another over-long UTF-8 sequence test." into main 2023-07-20 17:03:04 +00:00
Treehugger Robot
876f3668ac Merge changes I0845fdee,I879de1e8 into main
* changes:
  Fix mbrtoc16 reserved range test for musl.
  Fix surrogate pair deocding for musl/glibc.
2023-07-20 17:03:03 +00:00
Elliott Hughes
75e41cca99 Merge "De-pessimize SigSetConverter usage." into main am: ab9028c8ba
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2660920

Change-Id: I87aebeec09247f61f64bab31a7f04be82cfea1cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 16:55:26 +00:00
Elliott Hughes
ab9028c8ba Merge "De-pessimize SigSetConverter usage." into main 2023-07-20 16:03:27 +00:00
Treehugger Robot
7e6c5caa32 Merge "Sync upstream NetBSD." into main am: 87e7955d9f am: 13c835abfc
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2666315

Change-Id: Icc3e6b731be8d635ee81f892a5547e8dd7fc0f7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 15:44:28 +00:00
Treehugger Robot
fadc532f32 Merge "Sync upstream OpenBSD." into main am: 6de9b74b73 am: dc4b8d2c11
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2665210

Change-Id: Ide5eae816238c11bc24e9cea2cbae58ae2161539
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 15:44:17 +00:00