Commit graph

42665 commits

Author SHA1 Message Date
Elliott Hughes
81c54c72b3 Upstream sync.
Also clean up some obsolete cruft from openbsd-compat.h...

Test: treehugger
Change-Id: I9eae0f8304e701d032045617427289002d234cd8
2024-04-29 23:41:39 +00:00
Treehugger Robot
cdbc7c75f5 Merge "[scudo] -1 is also valid for M_DECAY_TIME" into main 2024-04-29 20:07:46 +00:00
Chia-hung Duan
6abb406e0a [scudo] -1 is also valid for M_DECAY_TIME
Test: Run tests
Change-Id: I044ef84bf0ec97c0f8cb8d3a2340b82218d85efc
2024-04-26 15:24:24 -07:00
Aditya Kumar
e7efd77d2c Merge "[RISC-V] Add misaligned load store tests" into main 2024-04-26 16:56:06 +00:00
Elliott Hughes
f789ddab1e Merge "get_executable_info: minor clarification." into main 2024-04-26 15:04:19 +00:00
Ryan Prichard
fc306b951b Merge "Revert "Switch the loader to a noexcept version of libc++"" into main 2024-04-26 01:52:16 +00:00
Ryan Prichard
698ca39c9e Revert "Switch the loader to a noexcept version of libc++"
Revert submission 2675705-use-prebuilt-libcxx

Reason for revert: breaks some Android tests (b/337120479, b/337121737, b/337122511)

Reverted changes: /q/submissionid:2675705-use-prebuilt-libcxx

Bug: 337120479
Bug: 337121737
Bug: 337122511
Change-Id: Ic5256fb1b4f09967ec29f36d8bdf96a16649ca05
2024-04-26 01:00:13 +00:00
AdityaK
24705dbdb5 [RISC-V] Add misaligned load store tests
hwprobe test may be insufficient to guarantee fast (or even supported) unaligned access.
Test case based on: https://github.com/llvm/llvm-project/issues/88029

Previous commit got reverted due to compiler errors(b/336800888).
Not sure why the errors were not detected in pre-submit builds.

Bug: https://github.com/google/android-riscv64/issues/142

Change-Id: If1c4150701298c0f351baa9ce1870509a00c250a
2024-04-25 16:15:00 -07:00
Ryan Prichard
686803d2a9 Merge "Switch the loader to a noexcept version of libc++" into main 2024-04-25 19:18:08 +00:00
Elliott Hughes
33de2737d9 get_executable_info: minor clarification.
Change the comment to explain _why_ we're resolving the path, get
rid of unnecessarily explicit strlen() calls, and make it clearer
that result.path is unconditionally initialized; it's just the
specific content that varies.

Change-Id: Iffbd5efc2eafd56e3efa3c0aaf7c191e6bb66a04
2024-04-25 16:44:48 +00:00
Treehugger Robot
c5be8dfe7c Merge "linker: use realpath instead of readlink when getting the symlink path" into main 2024-04-25 16:14:15 +00:00
Treehugger Robot
9c7892202f Merge "Only try to initialize appcompat properties if the folder is present" into main 2024-04-24 22:35:37 +00:00
Prashanth Swaminathan
f31e93c6e6 Merge "Revert "[RISC-V] Add misaligned load store tests"" into main 2024-04-24 18:12:54 +00:00
Prashanth Swaminathan
1cb919c07c Revert "[RISC-V] Add misaligned load store tests"
This reverts commit 4250342124.

Reason for revert: b/336800888, broke RISC-V build.

Change-Id: I8102bb0c20f80153b97853e5c988add31d4693fc
2024-04-24 16:43:44 +00:00
Aditya Kumar
cf02614a4b Merge "[RISC-V] Add misaligned load store tests" into main 2024-04-24 15:01:16 +00:00
AdityaK
4250342124 [RISC-V] Add misaligned load store tests
hwprobe test may be insufficient to guarantee fast (or even supported) unaligned access.

Bug: https://github.com/google/android-riscv64/issues/142
Bug: https://github.com/llvm/llvm-project/issues/88029

Change-Id: Ib673c5b752da8630296926e5ec7f59f41b686016
2024-04-23 13:17:04 -07:00
Elliott Hughes
5063d26249 Merge "Always use __foo__ for attribute names." into main 2024-04-23 00:12:32 +00:00
Treehugger Robot
ae038dcdea Merge "Replace commented-out deprecated attribute with doc comment." into main 2024-04-22 22:34:41 +00:00
Elliott Hughes
899d809bca Merge "__system_property_set: add string names for init's error codes." into main 2024-04-22 22:18:15 +00:00
Elliott Hughes
a933582f3e __system_property_set: add string names for init's error codes.
https://issuetracker.google.com/336223505 is not the first
hard-to-read bug here.

Change-Id: I520aeb2cb87423f8db394bf4709d659e3eb3a309
2024-04-22 22:18:06 +00:00
Elliott Hughes
9b9371bd0e Replace commented-out deprecated attribute with doc comment.
This attribute had been commented out since it was first
committed a decade ago. No-one's going to chase down arm32-only
trivia like that before arm32 and x86 are removed as obsolete...

Change-Id: I8e29d16657b3f4ce379e65732d747f969ea31dae
2024-04-22 20:17:22 +00:00
Elliott Hughes
a1b5ca2fe0 Always use __foo__ for attribute names.
To avoid collisions with other macros.

Change-Id: I015639043deaceccaf5f11365f8bdc45ca703da5
2024-04-22 20:10:53 +00:00
chenxinyuanchen
8d7c0f4f09 linker: use realpath instead of readlink when getting the symlink path
Fix the issue if link for an symlink that point to an relative path
cause the linker can not find the right absolute path.

For example:
lrwxr-xr-x 1 root shell 13 2009-01-01 08:00 /system/bin/app_process -> app_process64

the '/system/bin/app_process' is symlinked to 'app_process64' and will be failed.

if the 'exe_to_load' is null and also failed when stat '/proc/self/exe'
will entered this path.

Without Patch:
  [ Linking executable "app_process64" ]
  linker: CANNOT LINK EXECUTABLE "/system/bin/app_process": library "libnativeloader.so" not found: needed by main executable

With Patch:
  [ Linking executable "/system/bin/app_process64" ]
  [ Using config section "system" ]
  [ Jumping to _start (0x75593c3000)... ]

Test: Manual - Run app_process (symlinked to app_process64)

Change-Id: Iacd0a810a679e8d55d68d7e4c84f0e5e4f276b14
Signed-off-by: chenxinyuanchen <chenxinyuanchen@xiaomi.com>
Signed-off-by: chenxinyuanchen <chenxinyuanchen@xiaomi.corp-partner.google.com>
2024-04-22 06:44:29 +00:00
Elliott Hughes
ed21ffc70a Merge "Document pthread_key_create(3), pthread_key_delete(3), and PTHREAD_KEYS_MAX." into main 2024-04-20 15:18:56 +00:00
Nate Myren
9437444cf5 Only try to initialize appcompat properties if the folder is present
If the Init process doesn't write the appcompat system properties
folder, do not attempt to initialize it

Bug: 331307495
Test: manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d071e949a6153e76eb7c67e5947d4d387a8afe2d)
Merged-In: I21716ea87e55a63a1b79127887c451d0fcf006f3
Change-Id: I21716ea87e55a63a1b79127887c451d0fcf006f3
2024-04-19 19:07:34 +00:00
Elliott Hughes
7d3c6cd25c Document pthread_key_create(3), pthread_key_delete(3), and PTHREAD_KEYS_MAX.
In particular "how to work around the PTHREAD_KEYS_MAX limit".

Change-Id: I330936d598ddddfa0903f0505fd00f8fcbf02543
2024-04-18 22:02:38 +00:00
Christopher Ferris
785e161dd8 Merge "Update to v6.8 kernel headers." into main 2024-04-18 16:35:43 +00:00
Nick Desaulniers
5716586cf5 Merge "libc: remove __size_mul_overflow" into main 2024-04-18 16:09:05 +00:00
Nick Desaulniers
ceed466d60 libc: remove __size_mul_overflow
We should just be able to use __builtin_umull_overflow now, which expects
unsigned long parameters. We don't need __builtin_umul_overflow (which expects
unsigned ints) because Bionic is LP64 or ILP32, so for ILP32
sizeof(size_t) == sizeof(unsigned long),
so __builtin_umull_overflow will work for either ILP32 or LP64.

Test: mm
Change-Id: I872491731bca05e561767f8bfeda4c6704e10ccb
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2024-04-17 14:54:57 -07:00
Nick Desaulniers
0be8f184c2 Merge "Use inline keyword without underscores consistently" into main 2024-04-17 21:19:27 +00:00
Treehugger Robot
0b1161d9b5 Merge "Clean up __always_inline" into main 2024-04-17 20:19:14 +00:00
Nick Desaulniers
58f06e1112 Use inline keyword without underscores consistently
s/__inline__/inline
s/__inline/inline

Change-Id: I5d8d930a7a41d678a0795e7a608dacbb9eb8cb37
2024-04-17 10:51:09 -07:00
Nick Desaulniers
c574f79afa Clean up __always_inline
While studying the implementation of POSIX pthread_rwlock* functions, I noticed
that two functions were marked __always_inline twice. "They must really mean it
this time."

Also add back `inline` keyword to one other usage of __always_inline to be
consistent with other uses of __always_inline throughout the codebase.

Change-Id: Ibf9eaed5fc9fd03afcdd969cff82dec71a8ce30f
2024-04-17 10:50:41 -07:00
Florian Mayer
08b1404cc2 Merge "Fix incorrect links" into main 2024-04-16 23:03:22 +00:00
Florian Mayer
7d098bbee7 Fix incorrect links
Change-Id: Iee24c6b2e1a63d01359dadd5af7499fa3b4abaa5
2024-04-16 21:12:40 +00:00
Treehugger Robot
6b776d9db2 Merge "tlsdesc_resolver.S: use L() macro for local labels." into main 2024-04-16 17:01:35 +00:00
Christopher Ferris
b830ddf90e Update to v6.8 kernel headers.
Kernel headers coming from:

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

Test: Builds and bionic unit tests pass on raven.
Test: Able to log in to an Android GO 32 bit device.
Change-Id: I0022cdb20c19726f526acaab2866f1e25794b77e
2024-04-16 09:49:56 -07:00
Elliott Hughes
12773b6eca Merge "Simplify Oryon ifunc resolvers." into main 2024-04-16 15:06:14 +00:00
Elliott Hughes
f978a85cc3 Simplify Oryon ifunc resolvers.
Mainly just factoring out the code, but there are two functional
changes here too:

1. The inline assembler was missing `volatile`, making the hwcap
check ineffective (because the compiler would sometimes move the
MIDR_EL1 read above the hwcap check).

2. The previous code accepted variants 0x0 to 0x5 while the comment
said 0x1 to 0x5. The comment was correct.

I resisted the temptation to actually have a table to search on the assumption that it'll be a while before we need such a thing.

Bug: https://issuetracker.google.com/330105715
Change-Id: I9fdc1e70e49b26ef32794b55ca5e5fd37f1163f9
2024-04-16 15:05:55 +00:00
Treehugger Robot
e7f4506bcb Merge "Add LINE_MAX." into main 2024-04-15 23:20:22 +00:00
Treehugger Robot
d73b7b3e24 Merge "[[nodiscard]] the various ElfReader functions." into main 2024-04-10 23:59:15 +00:00
Elliott Hughes
396868c747 [[nodiscard]] the various ElfReader functions.
These are either only useful for their side-effects, or things you
really need to check.

Change-Id: I8e231185eb7fc8656fd3cb916169661833b525bf
2024-04-10 21:52:10 +00:00
Steven Moreland
117478dd4e Merge "Prefer __BIONIC_DEPRECATED_PAGE_SIZE_MACRO" into main 2024-04-10 20:57:45 +00:00
Mitch Phillips
4435aff516 Merge "[GWP-ASan] Use recoverable everywhere" into main 2024-04-10 09:30:58 +00:00
Treehugger Robot
3db97c73a2 Merge "Add NGROUPS." into main 2024-04-09 19:33:36 +00:00
Treehugger Robot
2f526fb4d1 Merge "<sys/shm.h>: fix a hard-coded 4096 page size." into main 2024-04-09 17:52:17 +00:00
Elliott Hughes
e5bd239ba1 Add NGROUPS.
Historical code still uses this, and people work around its absence
locally. All of iOS/macOS and musl/glibc have this.

Change-Id: I119834f535b346275be5fa1df3c323eee9e242cc
2024-04-09 16:48:18 +00:00
Elliott Hughes
f666d822bd <sys/shm.h>: fix a hard-coded 4096 page size.
Change-Id: I932b1ea44ab6a54a2e4d2bcd1577c6f5859f583a
2024-04-09 16:40:27 +00:00
Steven Moreland
a69e5af7ee Prefer __BIONIC_DEPRECATED_PAGE_SIZE_MACRO
Platform and future NDK releases will have no PAGE_SIZE by default,
unless __BIONIC_DEPRECATED_PAGE_SIZE_MACRO is specified.

This ensures that when people use these headers with non-standard build
systems, they will still become aware of the changes.

Bug: 312546062
Test: build/boot
Change-Id: I29f5de2cd5d59d3cefdd45a6da1ccdd7c12f1f19
2024-04-09 16:35:15 +00:00
Elliott Hughes
b266f6522f Add LINE_MAX.
LINE_MAX is a bad idea from the 1970s that we've ignored until now,
but there's already one hack in the AOSP tree (external/ltp) to work
around its absence, and kselftests would need another. Both uses are
bad code, but bad code exists, and iOS/macOS and musl/glibc all have
the same 2048 value, and it is in POSIX, so at least it's consistent
idiocy. Hopefully we're not encouraging more of it!

Bug: https://github.com/llvm/llvm-project/issues/88119
Change-Id: Ief219c3fe20b3d95da7040c4b9411f997b1c0470
2024-04-09 15:41:10 +00:00