Commit graph

11690 commits

Author SHA1 Message Date
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
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
Mitch Phillips
25ab1c2abf Merge "Use DYNAMIC entries for MTE enablement" into main am: 363e743200 am: 3b3a96de07 am: 059d2db070
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2765590

Change-Id: I307efae2207df52c9dffdfb920fa9df075d5c695
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-18 12:31:48 +00:00
Mitch Phillips
363e743200 Merge "Use DYNAMIC entries for MTE enablement" into main 2023-10-18 10:17:37 +00:00
Edward Liaw
4082c09e24 Merge "Add test for replacing macro arguments" into main am: f2f99ec626 am: a0b40cfe92 am: f60797d6b5
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2794634

Change-Id: I7d4a990f7af441efe3c17fdd87284e1e6f72a721
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-17 22:59:21 +00:00
Edward Liaw
372f2b07a3 Merge "Replace macro arguments when applying replaceTokens" into main am: 2f993a51bd am: 61124943f8 am: dccb59f76d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2792161

Change-Id: I3d275f7d4cc9c22e19faa4a43cc0cb5554b97aa7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-17 21:38:02 +00:00
Edward Liaw
d903a736fb Add test for replacing macro arguments
Add test for aosp/2792161

Bug: 297317502
Test: cpp.py
Change-Id: I2eadd3b9371ec2f8b8c24107888cad5e3ae26f60
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-10-17 20:09:42 +00:00
Edward Liaw
c291c39137 Replace macro arguments when applying replaceTokens
replaceTokens was only replacing tokens for cpp name clashes in the
macro body.  This change will also replace tokens in the arguments.

Bug: 297317502
Test: bionic/libc/kernel/tools/update_all.py
Change-Id: I102d000a8a4cea507b00c867df2a16106d8aed89
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-10-17 17:42:40 +00:00
Mitch Phillips
7c1f3770af Use DYNAMIC entries for MTE enablement
Adds support for the dynamic entries to specify MTE enablement. This is
now the preferred way for dynamically linked executables to specify to
the loader what mode MTE should be in, and whether stack MTE should be
enabled. In future, this is also needed for MTE globals support.

Leave the existing ELF note parsing as a backup option because dynamic
entries are not supported for fully static executables, and there's
still a bunch of glue sitting around in the build system and tests that
explicitly include the note. When -fsanitize=memtag* is specified, lld
will create the note implicitly (along with the new dynamic entries),
but at some point once we've cleaned up all the old references to the
note, we can remove the notegen from lld.

Bug: N/A
Test: atest bionic-unit-tests CtsBionicTestCases --test-filter=*Memtag*
Test: Build/boot the device under _fullmte.

Change-Id: I954b7e78afa5ff4274a3948b968cfad8eba94d88
2023-10-17 13:49:24 +02:00
Elliott Hughes
3f3bcb1372 Merge "Keep ioprio_value; <linux/ioprio.h> relies on this." into main am: 8fbdc58733 am: 211b6433db am: 289b4ef5f9 am: 7140fb9501 am: 674ef15589
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2787554

Change-Id: I3e92b4b150935c13e32f7703162fa166c1c4d495
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-13 18:41:47 +00:00
Elliott Hughes
b10c99d077 Keep ioprio_value; <linux/ioprio.h> relies on this.
We were keeping the macros that call this function, but not the function
itself. That's not helpful.

Bug: http://b/297317502
Test: treehugger
Change-Id: Icf8f734a129fe73ec740bb7cfbb11deb01a98cb3
2023-10-13 00:11:01 +00:00
Elliott Hughes
32c281cbb8 Merge "Clarify the fcntl() "that's not how F_SETFD works" error." into main am: b4e2219987 am: dfb9662b24 am: 4f1282b9bf am: 98c1a703b7 am: a4427fa9ab
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2780900

Change-Id: I7bc9c9f3e374731e0fdcf7b0815e09ff011a67b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 20:35:45 +00:00
Elliott Hughes
b4e2219987 Merge "Clarify the fcntl() "that's not how F_SETFD works" error." into main 2023-10-12 17:51:20 +00:00
Elliott Hughes
25af17c587 Clarify the fcntl() "that's not how F_SETFD works" error.
The first app developer (we know of) that hit this didn't understand
what it was trying to tell them.

Before:
    FORTIFY: fcntl(F_SETFD) passed non-FD_CLOEXEC flag: 0x801

After:
    FORTIFY: fcntl(F_SETFD) only supports FD_CLOEXEC but was passed 0x801

Bug: https://issuetracker.google.com/304348746
Test: treehugger
Change-Id: I8522e851d8f74c91152ebae68b083b5272d49255
2023-10-12 16:04:14 +00:00
Elliott Hughes
b7bbf03451 Merge "Sync upstream OpenBSD stdio." into main am: 1bcebdae38 am: 865d80a22f am: 728bd30de8 am: 22d4072750 am: 7158fefe24
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2779341

Change-Id: Ia40e1d7fbdde6d095d8290c58c4d1f1a8263356e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-11 01:36:24 +00: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
307ff340db Sync upstream OpenBSD stdio.
"""
__swsetup: set error flag and errno on error.

Previously, we set errno to EBADF if the cantwrite() macro (which calls
__swsetup()) returns true for POSIX compliance.  However, we neglected
to also set the error flag, __SERR.  Rather than set the error flag in
all callers of cantwrite(), set both errno and the error flag in
__swsetup().  This matches what FreeBSD does and makes it possible
to choose a proper errno value for the second error condition in
__swsetup().  OK deraadt@
"""
fc99cf9338

Bug: http://b/302742247
Test: treehugger
Change-Id: If3be4905fc21e513cb8718cca671eae3885e411a
2023-10-09 16:53:31 -07: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
Elliott Hughes
e37068889d Remove <ctype.h> cruft.
The NDK only supports API 21 and later, so we don't need to worry
about older API levels any more.

All the functions in this file are trivial, being but a single
instruction on most architectures. For that reason, we inline them by
default. (We continue to also provide actual symbols for any caller
that needs them --- in particular existing binaries!)

Also inline all the _l() variants too. No-one should be using them,
but since we're already using trickery to only implement the non-_l()
variants once, we may as well use the same trick for both.

Test: treehugger
Change-Id: I17637c49dd14be9e5ecb8246e72e8acc662739f1
2023-10-06 15:06:17 +00:00
Spandan Das
cdeedf90aa Merge "Delete cc_api_* bionic bazel targets" into main am: 17b35ecfd0 am: 5e8ea220d9 am: 24b37f48b0 am: 37ba12cef3 am: 0a899b21d6
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2776977

Change-Id: I7653ea1571cf743c8cb2e4d3bbf0fa210feb2bd7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 05:50:56 +00:00
Spandan Das
40467b2602 Delete cc_api_* bionic bazel targets
These targets were created for multi-tree. This use case is not very
relevant anymore, so cleanup these BUILD files

Test: m nothing
Test: presubmits
Bug: 284029211
Change-Id: Id2680df9cfe291ca10b4f007bbd05a338b2498c1
2023-10-05 23:22:05 +00:00
Treehugger Robot
0962881106 Merge "s/master/main/" into main am: a01b292ab9 am: f461a3878c am: 3852cfe4cb am: 3b3e2e9d46 am: 381d04c046
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2773870

Change-Id: If6c55eb8331d792fdb9836bc5cb32f220ed860a4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 21:12:57 +00:00
Treehugger Robot
a01b292ab9 Merge "s/master/main/" into main 2023-10-05 17:36:09 +00:00
Elliott Hughes
6b302c6354 Merge "Reduce duplication in the NOTICE file." into main am: 22743e3a7e am: f8d775b943 am: ce7fe40659 am: 9fc4c42656 am: 4023666514
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2773704

Change-Id: I51ff69aa78e23d3231778be1ddf1e9076b166cb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 02:51:24 +00:00
Elliott Hughes
9c06d16ca3 s/master/main/
Test: treehugger
Change-Id: I2c975b2f5f92f23c7357b6f7e785578504298cc6
2023-10-04 23:36:48 +00:00
Elliott Hughes
73e37b535a Reduce duplication in the NOTICE file.
Test: treehugger
Change-Id: I8a9c4f22534330dd498636a155b872bd2d2af5b6
2023-10-04 22:28:27 +00:00
Treehugger Robot
01f882b0b3 Merge "Create a filegroup for versioner dependencies" into main am: ae31683086 am: d19a29b6c8 am: d12edb29c0 am: 2052aa5c42 am: 27dc3f38ca
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2768530

Change-Id: I97481423c986286c9986e56bb411adf5cb3b7d00
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 03:48:34 +00:00
Treehugger Robot
ae31683086 Merge "Create a filegroup for versioner dependencies" into main 2023-10-04 01:08:11 +00:00
Elliott Hughes
c62df4090a Merge "riscv64: add vector stpcpy()." into main am: 45c7ae46d5 am: a16d951f61 am: 1cd2f5c125 am: a843667d27 am: 5a699aad65
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2768377

Change-Id: I92b80031fb322d65c50dd46fc5548681ef7fc671
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 20:23:54 +00:00
Elliott Hughes
45c7ae46d5 Merge "riscv64: add vector stpcpy()." into main 2023-10-03 17:49:06 +00:00
Elliott Hughes
3d84338eb7 riscv64: add vector stpcpy().
Bug: https://github.com/google/android-riscv64/issues/107
Test: treehugger
Change-Id: Ic1fb9da974769d2767ea2c092a2e97e095612e6e
2023-10-03 00:39:42 +00:00
Spandan Das
8fce52a3b3 Create a filegroup for versioner dependencies
As part of the build, soong runs the following cmd
```
$ versioner -o <out_dir> bionic/libc/include
bionic/libc/versioner-dependencies
```

To migrate this action to Bazel, create a filegroup module for
`bionic/libc/versioner-dependencies`. In Bazel builds, this target will
be copied to the Bazel's sandbox and placed on the include path when
running versioner. This should be a no-op in Soong.

`bionic/libc/versioner-dependencies` is a collection of symlinks, some of
which point to `prebuilts/clang-tools`. Bazel supports incremental
builds with symlinks out-of-the-box, so we do not need to add special
handling for this directory.

Bug: 301169067
Test: m nothing
Change-Id: I7cbb92e2248c194038a5690c81fed945dee61ccc
2023-09-29 23:49:53 +00:00
Elliott Hughes
7add1bbca8 Merge "Add strerrordesc_np() and strerrorname_np()." into main am: a67fe1b171 am: d37c19670a am: 5f921a71e1 am: 546379ea3d am: a2224bbe45
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2760166

Change-Id: Iae04cc2f17e272e0212b92dbeb5d776aeeb8cc62
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 04:05:28 +00:00
Elliott Hughes
a67fe1b171 Merge "Add strerrordesc_np() and strerrorname_np()." into main 2023-09-27 22:26:37 +00:00
Elliott Hughes
2109f12c3b Add strerrordesc_np() and strerrorname_np().
strerrordesc_np() isn't very useful (being just another name for
strerror()), but strerrorname_np() lets you get "ENOSYS" for ENOSYS,
which will make some of our test assertion messages clearer when we
switch over from strerror().

This also adds `%#m` formatting to all the relevant functions.

Test: treehugger
Change-Id: Icfe07a39a307d591c3f4f2a09d008dc021643062
2023-09-27 11:21:12 -07:00
Treehugger Robot
88dd367bef Merge "<sys/statvfs.h>: add a new mount option." into main am: 732b98203b am: a325f94c85 am: e7430e692f am: 4789e289f3 am: c9ca34ce85
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2760790

Change-Id: I32714539af9486e7e6db71d2c3ac452ac2134fc4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-23 05:00:48 +00:00
Elliott Hughes
6711d21230 <sys/statvfs.h>: add a new mount option.
This flag was added as part of
https://sites.google.com/a/chromium.org/dev/chromium-os/chromiumos-design-docs/hardening-against-malicious-stateful-data#TOC-Restricting-symlink-traversal
in 2020.

Annoyingly, these flags are in include/linux/statvfs.h rather than in
the uapi headers, so we don't get them for free.

Test: treehugger
Change-Id: I55c0dcc8a5da17c3efc8938ec04f23f157764d4d
2023-09-22 19:48:05 +00:00
Treehugger Robot
1de053cd59 Merge "Add the risc-v TLSDESC relocations." into main am: 631dfbb8ad am: ed30c58ae0 am: 843c792620 am: 2ded7e6e23 am: 77fd02d176
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2752785

Change-Id: Icc2c719959e6d725d8d5e778633da0e875e6eb4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-16 00:31:40 +00:00
Treehugger Robot
bd944ac9ec Merge "Consistent qualifier ordering." into main am: d72f4f8770 am: cecef1f2e6 am: 0f1c5dafbd am: aaf9ea2cda am: 65d0006871
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2751987

Change-Id: I547ba361d7413a9f4c6c0f5f621aa8bdb9e53047
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 21:50:30 +00:00
Treehugger Robot
631dfbb8ad Merge "Add the risc-v TLSDESC relocations." into main 2023-09-15 19:53:19 +00:00
Treehugger Robot
d72f4f8770 Merge "Consistent qualifier ordering." into main 2023-09-15 17:19:08 +00:00
Elliott Hughes
30088848fc Consistent qualifier ordering.
Change our handful of `constexpr static`s to the much more common
`static constexpr`. It's easier to "follow existing style" when there
aren't two existing styles to copy from, and all else being equal,
"majority wins" :-)

Test: treehugger
Change-Id: Ifbf0f62ab84c9450bf9c2e49e96915c126fd20c4
2023-09-14 18:36:55 +00:00
Elliott Hughes
ba7654ad92 Add the risc-v TLSDESC relocations.
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/94 was
merged.

Bug: https://github.com/google/android-riscv64/issues/3
Test: treehugger
Change-Id: Ifc0c4d7408367f0372cec969d4ee6f84699bee30
2023-09-14 18:02:17 +00:00
Christopher Ferris
ea86b9aeb5 Merge "Disable warning which is not detecting problems." into main am: a4bcacf79b am: b8f3980cc4 am: 18e46b12ac am: e532c59e2f am: bccab58e3a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2748796

Change-Id: Ic42b81b3406e8c48c79ae2a549e6c50c0659edd7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 03:53:24 +00:00