Commit graph

38015 commits

Author SHA1 Message Date
Greg Kaiser
6f02710ad2 Revert "Remove workarounds for the llvm sanitizers."
This reverts commit fa0e022b06.

Reason for revert: Appears to be causing crash_dump crashes in Go and/or 32-bit

Bug: 262391724
Change-Id: I3964aa9d6c7005313e6bf95b7e87d6a2ab08b52d
Test: Local revert on wembley
2022-12-13 17:20:04 +00:00
Elliott Hughes
1b663bb9f1 Merge "Ignore ART frames in fdtrack traces." 2022-12-13 17:04:23 +00:00
Pierre-Clément Tosi
74a1458116 Introduce minimal static libc for baremetal Rust
LLVM/rustc compiling no_std code expects a few libc symbols to be
defined (memcpy, memset, memcmp). Previously, we used the arm64 library
directly; instead, make the dependency arch-agnostic by exporting it
from Bionic, making it easier to add more libc functions (that might not
be implemented by the optimized routines), as necessary.

Test: m pvmfw_bin && atest vmbase_example.integration_test
Change-Id: I1d2cc69a25bbb7eddc67357a028b7b79d4909e79
2022-12-13 14:17:50 +00:00
Ryan Prichard
d791a6501e Merge changes I7ba9cef9,Ia191be0b,I16ba3dc8
* changes:
  Expose unwinder APIs in NDK stubs for R and up.
  Use abi::__cxa_demangle declared in cxxabi.h
  __cxa_atexit_test: declare __cxa_atexit and __cxa_finalize
2022-12-13 00:53:40 +00:00
zijunzhao
ab17c07f1e Nullability check for libgen module.
Bugs: b/245972273
Test: None
Change-Id: I41c741701a5b4416a09c3c683a0817b219262c6d
2022-12-13 00:06:09 +00:00
Christopher Ferris
6cd53a5f6b Update to v6.1 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-6.1

Test: Bionic unit tests pass.
Change-Id: I9414fb5e698a9806b85eb09e37d763849f08a468
2022-12-12 23:39:16 +00:00
Elliott Hughes
62d8f1a41a Merge "Remove workarounds for the llvm sanitizers." 2022-12-12 22:48:16 +00:00
Elliott Hughes
263faa90e1 Ignore ART frames in fdtrack traces.
Trying to find a leak this year, it was very annoying that our traces
were mostly filled with "junk" frames from the JNI implementation,
making it quite a struggle to see what the actual calling code was...

Bug: http://b/236197847
Test: treehugger
Change-Id: I69e7d9b6432e1872e238168ebf3dc36feb7de7df
2022-12-12 21:41:51 +00:00
Elliott Hughes
d3627a444f Sync strptime.c with upstream.
We still have local differences, but this minimizes (and documents) them.

Bug: http://b/167569813
Test: treehugger
Change-Id: Ib90e6ccc5ec1224e7ee89224a51b87fc48c9931f
2022-12-12 20:56:12 +00:00
Treehugger Robot
a5bce1b630 Merge "Add a code comment explaining the riscv64 TODOs in libm/Android.bp." 2022-12-12 18:59:10 +00:00
Elliott Hughes
7d2f1b3a46 Add a code comment explaining the riscv64 TODOs in libm/Android.bp.
Test: treehugger
Change-Id: Ia52217533328321375bc0cd132b8571c9b9874f5
2022-12-12 17:08:30 +00:00
Elliott Hughes
898394732d Merge "Use more compiler builtins for libm." 2022-12-12 16:41:10 +00:00
Elliott Hughes
edf386b1f9 Use more compiler builtins for libm.
Once we have an llvm with https://reviews.llvm.org/D136508, we will be
able to defer to more compiler builtins, but for now let's do what we
can...

Test: llvm-objdump (plus the tests still pass!)
Change-Id: Ia5c704409ca88ab1a02342c1b5dde8525da95243
2022-12-12 16:40:46 +00:00
Elliott Hughes
1287fd978f Merge "Move some cruft from the build system to the source." 2022-12-12 16:05:29 +00:00
Treehugger Robot
972d3cc892 Merge "Add rlim64_t to libc/include/sys/resource" 2022-12-10 08:27:54 +00:00
Ryan Prichard
fe504afea7 Expose unwinder APIs in NDK stubs for R and up.
These APIs are exposed in the on-device libc.so's .dynsym table from R
and up (e.g. _Unwind_xxx@@LIBC_R), but they were only available in the
APEX and LLNDK stubs. Expose the symbols from the NDK stubs too so that
the LLVM toolchain build can build a libc++.so that imports the
unwinder from libc.so. (The platform/APEX libc++.so will become a
toolchain prebuilt.)

Eventually this change will also allows apps to use the unwinder from
libc.so rather than linking libunwind.a statically.

Bug: http://b/175635923
Test: treehugger
Change-Id: I7ba9cef9a4727b49dd717e25a0321bf2889694de
2022-12-09 16:10:03 -08:00
Ryan Prichard
c2adad1815 Use abi::__cxa_demangle declared in cxxabi.h
Bug: http://b/175635923
Test: treehugger
Change-Id: Ia191be0b4861b011640edc703b55c13c88bce300
2022-12-09 16:10:00 -08:00
Elliott Hughes
8d9549e28a Move some cruft from the build system to the source.
It's more intention-revealing this way round anyway...

Test: treehugger
Change-Id: I561d8ac3003fa6b7f19fcf7110a6646c69bdd936
2022-12-09 19:58:00 +00:00
Ryan Prichard
321f34979c __cxa_atexit_test: declare __cxa_atexit and __cxa_finalize
After updating libc++, they're no longer declared in cxxabi.h, so the
test must declare them locally.

8bd0dc5bfe

Temporarily use a return type of "int" to avoid a Clang error about
conflicting return types.

Bug: http://b/175635923
Test: treehugger
Change-Id: I16ba3dc8cc84cc18ee7fbfe9d2e3fa0cd4eefeae
2022-12-08 17:43:29 -08:00
Elie Kheirallah
056549795c Add rlim64_t to libc/include/sys/resource
crosvm is using rlim64_t. Adding for portability.

Bug: 255594691
Test: m libc && m bionic
Change-Id: I752bfdaa23d900278fe7224306d785b0c9f67d3f
2022-12-08 23:32:11 +00:00
Elliott Hughes
a9fd9c2a44 Merge "Remove obsolete hacks for the fabs() family." am: 81168c00d8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2328560

Change-Id: Id9b3e842d935d5b369ebdb61b4175f5805d634f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 19:33:35 +00:00
Elliott Hughes
81168c00d8 Merge "Remove obsolete hacks for the fabs() family." 2022-12-08 18:03:06 +00:00
Elliott Hughes
591a2a798d Remove obsolete hacks for the fabs() family.
We don't support GCC any more, and clang's got better since this commit
was written. It doesn't produce _identical_ code, but it's a similar
single-instruction bit twiddle.

This also doesn't regress x86 for fabsl (that code looks the same before
and after) and there is no riscv32.

Test: llvm-objdump -d
Change-Id: I7acea6fd26f8760763f3744201ed42a99186562b
2022-12-05 20:58:15 +00:00
Elliott Hughes
73b32e5b0c Merge "Spring cleaning for the seccomp allowlist." am: c40ea825e7
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2324303

Change-Id: Ie570cec14ef055e6258001d9e950adb559175b30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-05 16:24:17 +00:00
Elliott Hughes
c40ea825e7 Merge "Spring cleaning for the seccomp allowlist." 2022-12-05 15:53:28 +00:00
Treehugger Robot
765b7e5952 Merge "Nullability check for stdlib module." am: 3f7c5a1753
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2320769

Change-Id: I40fd23c4977aaed762b3973c99bca947f8f55f3b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-03 07:24:29 +00:00
Treehugger Robot
3f7c5a1753 Merge "Nullability check for stdlib module." 2022-12-03 06:44:29 +00:00
Elliott Hughes
e5f266f6c4 Merge "Explicitly mention bionic's single C.UTF-8 locale." am: a226fb81f8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2324302

Change-Id: I51b5665faea288a57535eff4cab1bec14fc115b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 22:29:19 +00:00
Elliott Hughes
fa0e022b06 Remove workarounds for the llvm sanitizers.
We shouldn't need to poke these holes in seccomp now we're building the
sanitizers correctly.

Bug: http://b/229989971
Test: cuttlefish still boots with nothing untoward in the log
Change-Id: I2f9a050a86e670f000f44ad266ffdf404f3a1d1a
2022-12-02 22:20:22 +00:00
Elliott Hughes
a226fb81f8 Merge "Explicitly mention bionic's single C.UTF-8 locale." 2022-12-02 22:10:02 +00:00
zijunzhao
5a918d922b Nullability check for stdlib module.
Bugs: b/245972273
Test: None

Change-Id: Ib33a5359a924c21888f268158c4d7f824740dd55
2022-12-02 21:00:02 +00:00
Elliott Hughes
f9941705aa Spring cleaning for the seccomp allowlist.
Remove copy_file_range(2), preadv2(2), and pwritev2(2), all of which are
now in SYSCALLS.TXT.

Remove semtimedop_time64(2) since it doesn't make any sense to have an
exception for just the 64-bit-time_t-on-LP32 variant of a syscall we
don't even use --- this is the least likely variant of that syscall
to need an exception!

Also clean up the unnecessary foo:foo syntax (you only need the : if you
want the generated stub to have a different name, and here the names
were all identical _and_ the whole point of this file is to list
syscalls that we're not generating stubs for, this was doubly useless),
simplify the signatures to just the types (which is all we need), and
improve some of the commentary.

Test: treehugger
Change-Id: I691b5758a2165be9bbeafdd83f0c64d7eea987e5
2022-12-02 20:18:35 +00:00
Elliott Hughes
046fe15fb5 Explicitly mention bionic's single C.UTF-8 locale.
Test: treehugger
Change-Id: Iea45c0211d3476579f9778dfc7a0111f2e54a983
2022-12-02 20:15:42 +00:00
Elliott Hughes
23b2611cf8 Merge "fcntl: remove some duplication, fix a bug." am: 8262ca1dd8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2324643

Change-Id: Ia75e0bc052e3df46e4334cc7625b2180d03451de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 17:44:41 +00:00
Elliott Hughes
8262ca1dd8 Merge "fcntl: remove some duplication, fix a bug." 2022-12-02 17:19:16 +00:00
Jooyung Han
fa8b45adff Merge "linker_namespace: move sonames instead of copying" am: d2e85ae45b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2319860

Change-Id: I353715ed4c72fa02177349012faad23e7d11c871
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 06:31:13 +00:00
Jooyung Han
d2e85ae45b Merge "linker_namespace: move sonames instead of copying" 2022-12-02 06:12:43 +00:00
Elliott Hughes
1e59e2a88d fcntl: remove some duplication, fix a bug.
Treehugger didn't test 32-bit (and neither, of course, had I), so we
didn't notice until the next day that I'd only added the new check to
the 64-bit codepath. Let's just unify the two, since there's only one
line of meaningful difference.

Bug: http://b/261092827
Test: treehugger
Change-Id: I5178257a76fe24a340b3659c85ad29ed0a7b8b50
2022-12-02 02:56:50 +00:00
Florian Mayer
9bf7ccd3cc Merge "[MTE] test for exception cleanup." am: 7c2ce66b52
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2175188

Change-Id: I1cf60c15fac5dab7590e24dc5abedbd7c2750190
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 01:23:21 +00:00
Florian Mayer
7c2ce66b52 Merge "[MTE] test for exception cleanup." 2022-12-02 00:54:32 +00:00
Elliott Hughes
6198821b0a Merge "Add some missing "Available since" documentation." am: 008aa172d4
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2322714

Change-Id: Ib66f734da746bd1c0590a74220c903bf77d27c43
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 16:26:32 +00:00
Elliott Hughes
57c8d0adcb Merge "Tell people when they've messed up with fcntl(FD_SETFD)." am: 43ed024522
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1990812

Change-Id: Ied843d7e9d8fa603f3e76cd6de760efdb29a610e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 16:26:08 +00:00
Elliott Hughes
008aa172d4 Merge "Add some missing "Available since" documentation." 2022-12-01 16:21:58 +00:00
Elliott Hughes
43ed024522 Merge "Tell people when they've messed up with fcntl(FD_SETFD)." 2022-12-01 15:58:39 +00:00
Jooyung Han
57b03decd1 linker_namespace: move sonames instead of copying
android_namespace_link_t::shared_lib_sonames_ is unorderd_set<string>.
When initializing, it's copied a few times unnecessarily.
- when add_linked_namespace is called
- when android_namespace_link_t() is called
- when push_back is called.

Now, it's moved around after the initial creation.

Bug: n/a
Test: atest --test-mapping .
Change-Id: I283954bb0c0bbf94ebd74407137f492e08fd41bd
2022-12-01 16:23:03 +09:00
Elliott Hughes
dfe67d266c Tell people when they've messed up with fcntl(FD_SETFD).
This is a subtle bug that even experts struggle with.

Test: treehugger
Change-Id: If9cf16a1c32c836f5688bb3374cfd21d55125b17
2022-11-30 20:19:22 +00:00
Elliott Hughes
d4fd67ce69 Add some missing "Available since" documentation.
Also fix formatting of `errno` in one function.

Test: treehugger
Change-Id: Ibf362bcd36c901dab2a422afe09e0f78011315aa
2022-11-30 19:55:32 +00:00
Treehugger Robot
9c3f282c5a Merge "Remove stale TODO." am: 196e5b8514
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2309326

Change-Id: I7bf028c6b0aaf320db1a5ef3d25fd9866385a24b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 14:27:38 +00:00
Treehugger Robot
196e5b8514 Merge "Remove stale TODO." 2022-11-30 13:54:47 +00:00
Elliott Hughes
d2eaa336bd Merge "Remove remaining "ASCII binary blobs"." am: c88467704f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2309609

Change-Id: I7d3fdfc5ef55caa41cf14453b56103ba2deae09b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 16:40:23 +00:00