Commit graph

2513 commits

Author SHA1 Message Date
Elliott Hughes
c608e57893 Merge "Use the canonical idiom for sockaddr_storage." into main am: bb261225e0 am: 3f5aaa8812 am: 4b694b6969
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2852650

Change-Id: I70804a869978bd6f27482530af7446a2cc57b33b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-08 16:28:27 +00:00
Elliott Hughes
bb261225e0 Merge "Use the canonical idiom for sockaddr_storage." into main 2023-12-08 14:43:32 +00:00
Juan Yescas
f7f17a8dac Merge "16k: Set PTHREAD_STACK_MIN to 16384/8192 for 64-bit/32-bit archs" into main am: 93e0616836 am: 2fe3c7f701 am: 50fbc4d8a9
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2864176

Change-Id: I1be6a6ab7cf232eb02261af8666dbeba2cde1390
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-08 05:45:19 +00:00
Juan Yescas
c065a2731a 16k: Set PTHREAD_STACK_MIN to 16384/8192 for 64-bit/32-bit archs
Set PTHREAD_STACK_MIN will be set to:

- 16384 for 64-bit arch
- 8192 for 32-bit arch

Bug: 315174209
Test: Built and start the targets
      - aosp_cf_arm64_phone_pgagnostic
      - aosp_cf_x86_64_phone
Change-Id: I8bb20a3433e615f9f80a0d52051f2e1635d4301a
2023-12-07 16:07:08 -08:00
Juan Yescas
8de167971d Merge "bionic: Do not use PAGE_SIZE to define PTHREAD_STACK_MIN" into main am: b49314108d am: b3f5421462 am: d9bb13ac1e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2860686

Change-Id: Ib96af1b18f8fe3deed9c08800a3454e2bdb584e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-06 21:32:10 +00:00
Elliott Hughes
2cbd262cf1 Merge "riscv64: pass a pointer to __riscv_hwprobe() to ifunc resolvers." into main am: 75539ab928 am: 978c235f51 am: 53adad316c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2860689

Change-Id: I86a97139f856341ab257b5092b72e00abf2b0bed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-06 20:27:53 +00:00
Juan Yescas
b49314108d Merge "bionic: Do not use PAGE_SIZE to define PTHREAD_STACK_MIN" into main 2023-12-06 19:58:01 +00:00
Elliott Hughes
75539ab928 Merge "riscv64: pass a pointer to __riscv_hwprobe() to ifunc resolvers." into main 2023-12-06 17:57:53 +00:00
Elliott Hughes
10cd6a9d4f Merge "Avoid multiple definitions of struct tcphdr." into main am: 001fabaa90 am: 28ea9363b6 am: 6bed16b594
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2850373

Change-Id: I0e0b0d398d3473bd1f9b85f11a0daac4bab693b4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-06 00:54:41 +00:00
Elliott Hughes
561e804ffb riscv64: pass a pointer to __riscv_hwprobe() to ifunc resolvers.
This way, callees don't need to worry about whether or not their
reference to __riscv_hwprobe() has been resolved before their ifunc
resolver is called.

This matches the current glibc proposal from rivos.

Test: treehugger
Change-Id: I0d5244aa837d0d1f0e6bd7d22091dfedb8a55bdb
2023-12-05 16:31:59 -08:00
Juan Yescas
b40f7b911d bionic: Do not use PAGE_SIZE to define PTHREAD_STACK_MIN
There is no need to use PAGE_SIZE to define the value of
PTHREAD_STACK_MIN.

Bug: 312546062
Bug: 313941999
Test: source build/envsetup.sh
      lunch aosp_cf_arm64_phone_pgagnostic-trunk-userdebug
      m
Change-Id: If3c3fe39f50592df58634d1c164e87dcd0aebad0
2023-12-05 16:03:33 -08:00
Elliott Hughes
5850f6f3be Use the canonical idiom for sockaddr_storage.
This works out a bit silly/ugly because the bits/ header file has the
wrong name, so I've also changed the map from kernel struct to boolean
to be a map from kernel struct to filename. That not only fixes this,
it's a bit more readable too. (Just yesterday, when I had no real reason
to change it, I was asking myself "why is this a boolean?"!)

Bug: http://b/236042740
Test: treehugger
Change-Id: I3eee25b493ea97d46cc5dc5fde07f7c5e77d2a46
2023-12-05 23:13:01 +00:00
Elliott Hughes
001fabaa90 Merge "Avoid multiple definitions of struct tcphdr." into main 2023-12-05 23:09:32 +00:00
Elliott Hughes
e5f0b8a529 Merge "Avoid multiple definitions of sigaction." into main am: 3906f3bc83 am: 222f4ca434 am: efb0a10807
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2849972

Change-Id: I7ff80d1bdff69962e7f1a46dc6e5fa8ca6ce0026
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 20:54:49 +00:00
Elliott Hughes
b4a9b17a55 Avoid multiple definitions of struct tcphdr.
No-one's hit this in practice, that I know of, but there are very few
instances of this old workaround for kernel/userspace mismatches still
present, and (as part of the much harder and less effective `struct
sigaction` cleanup), we should just remove them.

Bug: http://b/236042740
Test: treehugger
Change-Id: I6c71d4353044cf57cfa8a9796a4c3d6a4d51cd86
2023-11-28 15:41:54 -08:00
Elliott Hughes
df53b16fca Avoid multiple definitions of sigaction.
Before this change, we have the kernel's sigaction in the uapi headers,
and our own sigaction in <bits/signal_types.h> and we rely on callers
making sure to use `#define` to move the kernel type out of the way if
they include a uapi header directly. This is obviously error-prone and
undesireable, and not what we usually do now.

What we _usually_ do now is use the header scrubber's ability to replace
a struct definition with a `#include <bits/STRUCT.h>`, but that doesn't
work here because struct sigaction relies on a lot of other types,
some of which also come from uapi headers.

So instead use our second best trick, which is to "move the kernel struct
out of the way" at header scrubbing time instead. This means that someone
who does `#include <linux/signal.h>` or `#include <asm/signal.h>` won't
get `struct sigaction` (they'll only have `struct __kernel_sigaction`
instead), but it does mean that they can't get two incompatible
definitions if they include a uapi header both directly and indirectly.

So although this doesn't do what I'd set out to do, it's still an
improvement in some cases, and it's our preferred idiom in most cases
anyway. (I'll come back once this is in to tidy up the two other kernel
structs where we're still using the deprecated "rename out of the way
using #define" trick, but this change is already hairy enough, and
there's a possibility it will break code that didn't care that it was
getting the kernel `struct sigaction` rather than the userspace one.)

Bug: http://b/236042740
Test: treehugger
Change-Id: Icff50e330c09c587e8f77ba0fb7cffffd9c3b708
2023-11-28 14:20:43 -08:00
Treehugger Robot
21ec4adb23 Merge "Move ; in NDK declaration" into main am: c6034e4228 am: ec6677350c am: 15c9f8f608
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2830814

Change-Id: I5bcfbb42ea39d291bbc47b52f4b1852d8547dffb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 02:11:04 +00:00
Treehugger Robot
c6034e4228 Merge "Move ; in NDK declaration" into main 2023-11-15 00:26:40 +00:00
Nate Myren
4b94522c14 Move ; in NDK declaration
per comment on aosp/2796861, it should be at the end of the line

Bug: 291814949
Test: presubmit
Change-Id: Ib104d6764791b7a2507e371d955cbd8e69e3ccdc
2023-11-14 15:28:57 -08:00
Treehugger Robot
034c05be11 Merge "string.h: drag in <strings.h> for GNU source as well as BSD." into main am: fb85d77da6 am: e57e7f3102 am: 5614a5815c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2828517

Change-Id: I09326b1a10226ac2f3bffe4a049041c8deae1c43
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-14 19:57:51 +00:00
Treehugger Robot
fb85d77da6 Merge "string.h: drag in <strings.h> for GNU source as well as BSD." into main 2023-11-14 17:59:13 +00:00
Elliott Hughes
c5d9795cf4 string.h: drag in <strings.h> for GNU source as well as BSD.
Both glibc/musl's and Apple's <string.h> drags in <strings.h> in most
cases. So do the BSDs. Given so much historic precedent (often accompanied
by comments saying "POSIX made us move this stuff out into another
file, but we don't want to break existing code [from the 1980s]"!), plus
the fact that someone hit this in practice, trying to build one of the
linux selftests against bionic, let's change bionic over too...

Bug: http://b/310035365
Test: treehugger
Change-Id: I8f13d82fe3d3df71a656641a725410acdfd97465
2023-11-14 00:40:30 +00:00
Treehugger Robot
93bf1d0a99 Merge "elf.h: add SHT_RISCV_ATTRIBUTES." into main am: 5512532418 am: 64bc0859a3 am: ce9887d94c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2818165

Change-Id: I13a3ee00299f2afc756703d31047e1728069ff2d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-04 03:45:04 +00:00
Treehugger Robot
5512532418 Merge "elf.h: add SHT_RISCV_ATTRIBUTES." into main 2023-11-04 02:19:11 +00:00
Elliott Hughes
a3f24eb6b2 elf.h: add SHT_RISCV_ATTRIBUTES.
Test: treehugger
Change-Id: I1919ae440f56c46aad0948e4535eb6fc90b10895
2023-11-03 17:25:09 -07:00
Christopher Ferris
f9a2674094 Merge "Update to v6.6 kernel headers." into main am: 85dd55530a am: 511a846c42 am: 8094b84e28
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2812362

Change-Id: I15e1aa6bec3fa89568ff4ba1242c25978884999f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 03:20:21 +00:00
Treehugger Robot
8611847e5a Merge "time.h: use "duration" rather than "request"." into main am: 318a1276b4 am: 0dc540d286 am: 84d495f57e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2813844

Change-Id: I564ef94ed6e9e14a419b97a53090bac48d079de0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 03:19:55 +00:00
Treehugger Robot
8d05992702 Merge "dlfcn.h: dlclose doc ~'do not use'" into main am: 2e9bc49ac5 am: 227e78148d am: a900808621
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2813726

Change-Id: Ice29c3d56b92b78d2298d8bcbc2475326dd5b6f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 03:19:09 +00:00
Christopher Ferris
85dd55530a Merge "Update to v6.6 kernel headers." into main 2023-11-01 02:14:31 +00:00
Treehugger Robot
318a1276b4 Merge "time.h: use "duration" rather than "request"." into main 2023-11-01 02:02:23 +00:00
Treehugger Robot
2e9bc49ac5 Merge "dlfcn.h: dlclose doc ~'do not use'" into main 2023-11-01 01:54:25 +00:00
Steven Moreland
f61b2b16b8 dlfcn.h: dlclose doc ~'do not use'
There are a lot of bugs about this over the years, too many to
reference here. Though, I referenced b/176065420 to understand
exactly why it's problematic and what the future direction may
be.

Fixes: 307859642
Test: N/A
Change-Id: Ida31fe622309a7f9b2cd55e5bbb3569fc5aded0e
2023-11-01 00:48:24 +00:00
Elliott Hughes
77add1bbfd time.h: use "duration" rather than "request".
This came up in a man-pages discussion. I've left the ones that take an
integer to say what _units_ they sleep in, but the ones that take a
struct seem clearest if they just say "duration".

Test: treehugger
Change-Id: I13e39855a9d2c49e1653ec2263cb09c9f239254d
2023-11-01 00:34:47 +00:00
Christopher Ferris
67d1e5eb74 Update to v6.6 kernel headers.
Kernel headers coming from:

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

Test: Builds and bionic unit tests pass on raven.
Test: Able to log in to an Android GO 32 bit device.
Change-Id: Ib5ff5a23f382721d98d1e428a295c6794b190d8d
2023-10-31 13:36:37 -07:00
Treehugger Robot
d78dfdb75a Merge changes from topic "appcompat_override" into main am: 0207a6a186 am: 9460fe5a83 am: 3fd59cb6af
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2796861

Change-Id: I1c6d5b67876e69650e721e465533ee897983efc4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 03:56:37 +00:00
Treehugger Robot
0207a6a186 Merge changes from topic "appcompat_override" into main
* changes:
  Move __system_properties_reload to LIBC from LIBC_PLATFORM
  Write appcompat_override system properties
2023-10-31 02:29:57 +00:00
Treehugger Robot
2d7fdf4307 Merge "Explain why system(3)'s argument is marked _Nonnull." into main am: 19346eaaec am: 33e9fe330c am: 73a05a9dce
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2807093

Change-Id: I906bc95974bcf14afe8c2179716dd7fcc273d846
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-27 01:20:02 +00:00
Elliott Hughes
cc87eec645 Explain why system(3)'s argument is marked _Nonnull.
Change-Id: I566f982148c58e74db55ccbd762e0e4ca9fad240
2023-10-26 21:28:58 +00:00
Nate Myren
0ab0615f8c Move __system_properties_reload to LIBC from LIBC_PLATFORM
The zygote cannot have visiblity to LIBC_PLATFORM methods. Therefore,
move __system_properties_reload to LIBC, and rename it
__system_properties_zygote_reload, and indicate in comments that it
should not be used by non-zygote apps

Bug: 291814949
Test: atest CtsBionicRootTestCases
Change-Id: Iee8fa0c76b740543c05a433393f2f4bef36d6d3d
2023-10-25 17:41:33 -07:00
Treehugger Robot
ff55925cd4 Merge "<syslog.h>: add facilitynames[] and prioritynames[]." into main am: 7bdcf765fa am: 7b6325cd05 am: c269f679d9
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2799343

Change-Id: If08ccd4e62a6af692db1beb7cc52abb707bc8372
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-24 02:43:22 +00:00
Elliott Hughes
afb8e05eb3 <syslog.h>: add facilitynames[] and prioritynames[].
Test: treehugger
Change-Id: I2a65b3088fe5a28b66e7d1c2a8caa10cb4467202
2023-10-23 17:47:15 -07:00
Nate Myren
b8c87b14b0 Write appcompat_override system properties
Create a second set of system properties, that can be overlaid over the
real ones if necessary, for appcompat purposes.

Bug: 291814949
Ignore-AOSP-First: Aosp -> internal merge conflict
Test: manual, treehugger, system_properties_test

Change-Id: I541d3658cab7753c16970957c6ab4fc8bd68d8f3
Merged-In: I884a78b67679c1f0b90a6c0159b17ab007f8cc60
2023-10-19 13:35:57 -07:00
Nate Myren
19d8167626 Merge "Write appcompat_override system properties" into main 2023-10-19 19:29:59 +00:00
Treehugger Robot
8f7b679767 Merge "Clarify one of the "missing" FreeBSD ELF constants." into main am: b8021fbe21 am: bbedb0295b am: bdc8f354b9
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2796853

Change-Id: I87aaec664797e4654aff470df444dd950e51eca6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-19 01:23:09 +00:00
Nate Myren
ae7f33dd57 Write appcompat_override system properties
Create a second set of system properties, that can be overlaid over the
real ones if necessary, for appcompat purposes.

Bug: 291814949
Ignore-AOSP-First: Aosp -> internal merge conflict
Test: manual, treehugger, system_properties_test

Change-Id: I884a78b67679c1f0b90a6c0159b17ab007f8cc60
2023-10-18 17:28:42 -07:00
Elliott Hughes
dcfd870fac Clarify one of the "missing" FreeBSD ELF constants.
Test: treehugger
Change-Id: I7173ac704e6537a4e99a976baec46aa22df751bd
2023-10-18 14:47:12 -07:00
Treehugger Robot
50d4e9d550 Merge "<ctype.h>: stop using _ctype_." into main am: e253761e14 am: 01de1a47fa am: aba9b2107d am: e00cd3f4cb am: 24c836e906
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2779335

Change-Id: I962271d3bffddb528601b2e54cf426d569337fd4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-10 03:24:23 +00:00
Elliott Hughes
69270ed6b9 <ctype.h>: stop using _ctype_.
The code comment that's being removed here defends the old
implementation by claiming that it's faster. Annoyingly, we don't know
what hardware that was run on. Running on current-ish hardware
(cheetah), I can't really tell the difference except: (a) for hwasan,
avoiding the unsafe memory access by _not_ using the array is a huge
win, and (b) even for arm32 the logic is (very slightly) faster than the
array lookup.

So let's get rid of the unsafety (as musl and FreeBSD have already done)
and the large hwasan slowdown (10ns vs 2ns). It's possible in-order
cores might still care, but it's 2023 and it's time to move on.

This change _does not_ remove `_ctype_` and associated macros from the
headers, though we might want to come back and do that. Historically
libc++ used these implementation details directly, but that's no longer
the case, and it seems unlikely that anyone else is, and today's results
suggest they probably shouldn't anyway, and doing so only ever really
made sense for something like ISO-Latin-1 anyway. Most ASCII tests are
_always_ better off inlined, and Android's never supported non-ASCII for
<ctype.h> anyway (use the isw*() functions if you want that, but bear in
mind that if you're actually dealing with human languages, you probably
want icu4c rather than libc anyway).

Test: treehugger & benchmarks
Change-Id: Ifac25c23ac33e996a3c726317b5c6e602dc72e30
2023-10-09 13:53:03 -07:00
Elliott Hughes
f1ce4648a9 Merge "Remove <ctype.h> cruft." into main am: 389a40a0a8 am: a468e56569 am: bc717f9b8d am: 4ca2aabbff am: ac7ef66045
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2455758

Change-Id: If05fcc6343f23138f026fe0759948ca3f6fae967
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-07 00:59:27 +00:00
Elliott Hughes
389a40a0a8 Merge "Remove <ctype.h> cruft." into main 2023-10-06 19:49:26 +00:00