Commit graph

38546 commits

Author SHA1 Message Date
Treehugger Robot
d9fa32e99f Merge "More printf unification: FLUSH()." 2023-05-09 21:46:12 +00:00
Elliott Hughes
26a0ebd24b More printf unification: FLUSH().
wprintf doesn't need this (and already only has the iov stuff because
the non-wide printf implementation needs it), but we can further reduce
the diff between the two implementations by defining a no-op FLUSH() for
wide characters.

Test: treehugger
Change-Id: Ifefcb4b8474b086f995e2b0796f61558a19e2a42
2023-05-09 11:54:09 -07:00
Elliott Hughes
44befb2286 Merge "Clean up stdio snprintf()/swprintf() tests." 2023-05-09 18:15:16 +00:00
Treehugger Robot
68904aee7b Merge "Make fork equivalent to vfork when HWASan or MTE stack tagging is enabled." 2023-05-09 00:53:48 +00:00
Elliott Hughes
8fd4e96e2a Clean up stdio snprintf()/swprintf() tests.
This reduces the amount of boilerplate for these tests, and ensures that
we have a corresponding swprintf() test for every snprintf() test
(except the handful where it doesn't make sense; we have no FORTIFY for
the wide-character routine, for example).

Test: treehugger
Change-Id: I14091683494bbb414f1a72bddc9835b86ff62526
2023-05-08 17:31:40 -07:00
Peter Collingbourne
b6a592b25b Make fork equivalent to vfork when HWASan or MTE stack tagging is enabled.
Bug: 274056091
Change-Id: Iac029ca6b0e26f57f20c0a54822b75e3cae67344
2023-05-08 15:26:00 -07:00
Treehugger Robot
e60b4c7c2f Merge "Explain the header tests better." 2023-05-08 21:54:22 +00:00
Elliott Hughes
32c9572424 Explain the header tests better.
Bug: https://github.com/google/android-riscv64/issues/88
Test: N/A
Change-Id: Ia2a8673e96eb7aeb795fb7158f4814e5af9c8e94
2023-05-08 19:14:28 +00:00
Treehugger Robot
d16b682f0d Merge "doc: add desc for riscv together with other ARCHs" 2023-05-08 16:48:18 +00:00
Wang Chen
a6a9d5757e doc: add desc for riscv together with other ARCHs
Test: doc changes, no test required.

Change-Id: I30311d4edc12e623567b5622a65339fb61c9a5f3
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
2023-05-08 16:55:21 +08:00
Zijun Zhao
aaaf468370 Merge "Nullability check for uio module." 2023-05-04 20:52:09 +00:00
Elliott Hughes
e023a02cce Merge "<time.h>: change the new C23 TIME_ constants." 2023-05-04 17:35:17 +00:00
zijunzhao
d633600d1c Nullability check for uio module.
Bugs: b/245972273
Test: adb shell
Change-Id: I132f618c50f7b7a3f9b9ef26c9ac1a87a97a1b78
2023-05-04 17:13:15 +00:00
Elliott Hughes
1dff230f75 Merge "syslog.h: implement LOG_PERROR." 2023-05-04 15:09:51 +00:00
Elliott Hughes
7db0a6cc5f <time.h>: change the new C23 TIME_ constants.
Jens Gustedt suggested a better implementation last year on the musl
mailing list: https://www.openwall.com/lists/musl/2022/11/19/1

It means the constants are sparse, but in return it means we can add
future constants and they'll be backward compatible. (Sadly you'll need
to be on API level 35 before you can use anything but TIME_UTC.)

I doubt this will ever matter, because everyone should just stick to
clock_gettime()/clock_getres() anyway, and anyone who does have a
legitimate use for timespec_get() and timespec_getres() probably needs
to support non-Linux and so can't use any clocks that aren't in ISO C
anyway. But given that we don't _have_ to paint ourselves into a corner
here, we may as well take the opportunity to not do so.

Test: strace
Change-Id: I293d32fcbcf7f6703564dac0978ae2a10192a482
2023-05-03 15:37:46 -07:00
Elliott Hughes
9118450303 Merge "Add an enum for the riscv64 <sys/ucontext.h> register constants." 2023-05-03 21:43:24 +00:00
Elliott Hughes
213d943a33 syslog.h: implement LOG_PERROR.
This is the one openlog() flag that toybox uses. We should probably try
to unify toybox's POSIX logger and Android-specific log at some point,
and this will help.

Also fix our behavior with an empty format string, noticed while adding
tests.

Test: treehugger
Test: adb shell logger -s foo
Change-Id: Ic027e78a460be3db83cc4c6f9946c9efa22be6e1
2023-05-03 14:19:40 -07:00
Elliott Hughes
7fc63f2c9a Add an enum for the riscv64 <sys/ucontext.h> register constants.
That lets us have idempotent #defines to reduce namespace pollution.

Bug: http://b/279405445
Test: treehugger
Change-Id: I00312cc8911025696cf0eea2d70e3219ab361613
2023-05-03 17:45:41 +00:00
Treehugger Robot
e61cf18c3c Merge "Nullability check for get_device_api_level_inlines module." 2023-05-03 02:06:08 +00:00
Treehugger Robot
ebd654640a Merge "Implement C23 printf 'wf' length modifiers" 2023-05-02 23:44:37 +00:00
zijunzhao
136e28fa8b Nullability check for get_device_api_level_inlines module.
Bugs: b/245972273
Test: adb shell
Change-Id: I49d64a12b542c8f3723f89531c63d10b84d16d26
2023-05-02 23:36:34 +00:00
zijunzhao
1fdece95d3 Implement C23 printf 'wf' length modifiers
wfN: Specifies that a following b, d, i, o, u, x, or X conversion specifier applies to a fastest minimum-width integer argument with a specific width where N is a positive decimal integer with no leading zeros (the argument will have been promoted according to the integer promotions, but its value shall be converted to the unpromoted type); or that a following n conversion specifier applies to a pointer to a fastest minimum-width integer type argument with a width of N bits. All fastest minimum-width integer types (7.22.1.3) defined in the header <stdint.h> shall be supported. Other supported values of N are implementation-defined.

Bug: b/271903607
Test: adb shell
Change-Id: Ida36d5a50af2a46fd04cb5fe039793d8872f9f3b
2023-05-02 21:06:09 +00:00
Elliott Hughes
721b93d7ec Merge "Fix the WIFSTOPPED definition." 2023-05-02 14:40:15 +00:00
Elliott Hughes
2b8ca55d14 Fix the WIFSTOPPED definition.
Although this breaks job control in several shells (including mksh),
this has been broken since the initial commit and no-one's noticed until
now.

Bug: https://github.com/android/ndk/issues/1878
Test: treehugger
Change-Id: Id7c4805965c5e5847db99b57df1af13355adcc22
2023-05-01 19:48:12 +00:00
Treehugger Robot
c5ca568b96 Merge "Nullability check for getopt module." 2023-05-01 18:48:25 +00:00
zijunzhao
d3f2f109fc Nullability check for getopt module.
Bugs: b/245972273
Test: adb shell
Change-Id: I243bb87fe26beecd376d894b25cedd993c246880
2023-05-01 16:19:44 +00:00
Zijun Zhao
20fa28e564 Merge "Nullability check for resource module." 2023-05-01 16:16:42 +00:00
zijunzhao
a23e448288 Nullability check for resource module.
Bugs: b/245972273
Test: adb shell
Change-Id: Ia875f9e0189f72317276cc28bfe6faf1f95c2908
2023-04-28 22:18:02 +00:00
Treehugger Robot
3ee441491a Merge "Nullability check for ctype_inlines module." 2023-04-28 20:57:27 +00:00
Almaz Mingaleev
8cad3f9776 Merge "Update tzcode from 2022a to 2023a." 2023-04-28 18:41:33 +00:00
zijunzhao
b4e4d05439 Nullability check for ctype_inlines module.
Bugs: b/245972273
Test: adb shell
Change-Id: I7645c51d40a226cc90bfbf8587e8b094c0c38242
2023-04-28 18:02:12 +00:00
Christopher Ferris
a12856c579 Merge "Modify the wording of the mallopt." 2023-04-28 16:16:22 +00:00
Almaz Mingaleev
d86a3ab241 Update tzcode from 2022a to 2023a.
57b8fc957a
changes the way overflows are tracked: now compiler builtins
are used instead of manual arithmetics. But as int_fast32_t on
64-bit Android takes 8 bytes, new logic behaves differently.
See time_test.cpp changes for more details.

Changes were applied using following commands:
  1) Checkout tzcode repo
  2) Prepare patches for all tzcode file using
    git diff 2022a 2023a -- <file-name> > <file-name-patch>
  3) Apply these patches to files in bionic using
    patch -p1 <file-name> <file-name-patch>

Bug: 279742606
Test: CtsBionicTestCases
Test: CtsLibcoreTestCases
Test: CtsLibcoreOjTestCases
Test: atest toybox-tests
Change-Id: I7772a90538b8185bdd2f4be6e9d1740c95509d6c
2023-04-28 16:52:53 +01:00
Christopher Ferris
e28867ca6e Modify the wording of the mallopt.
The original wording implies that memory tagging can be disabled
per thread. That is not really possible, and doesn't happen. Instead,
this option only turns off some of the memory tagging initialization.
Leave this slightly vague since it's possible this might change
in the future.

Bug: 272383932

Test: NA
Change-Id: I6333f16175edb52a38aadfc67ce7c9ce76113e59
2023-04-27 17:07:17 -07:00
Treehugger Robot
028bb5473b Merge "Nullability check for strcasecmp module." 2023-04-27 21:20:09 +00:00
Treehugger Robot
056ffc6b9c Merge "Nullability check for swab module." 2023-04-27 20:39:29 +00:00
zijunzhao
88f4b1a957 Nullability check for strcasecmp module.
Bugs: b/245972273
Test: adb shell
Change-Id: Ic6322e957cccd827fe437a4a3dd2848036913f29
2023-04-27 18:03:38 +00:00
zijunzhao
628d8ca6eb Nullability check for swab module.
Bugs: b/245972273
Test: adb shell
Change-Id: I92ce194ac12cbc337932357567b8450c484f93f3
2023-04-27 18:01:33 +00:00
Elliott Hughes
0593e7922f Merge "C23: add timespec_getres() and the new TIME_* constants." 2023-04-27 15:25:06 +00:00
Treehugger Robot
c35f7d6a84 Merge "Set __BIONIC_COMPLICATED_NULLNESS for the vsnprintf family" 2023-04-27 01:50:38 +00:00
zijunzhao
e1833e54a7 Set __BIONIC_COMPLICATED_NULLNESS for the vsnprintf family
When annotating the netinet directory aosp/2552567, we realize the
argment s for vsnprintf family can be null only if the buffer size is 0.
So we correct them and add some tests to verify our assumption.

Bugs: b/245972273
Test: adb shell
Change-Id: I51063286272be0daee0d7c1453a374b1f5674481
2023-04-26 23:14:36 +00:00
Elliott Hughes
52541eea33 C23: add timespec_getres() and the new TIME_* constants.
Nothing to see here --- you'll want to keep using POSIX clock_gettime()
and clock_getres() instead. But portable code might use this eventually,
and it's trivial, so let's add it anyway.

(The whole "zero as an error return" precluding the direct use of
Linux's CLOCK_ constants is what really makes this a terrible API ---
we're going to have to add explicit translation any time they add a
new base.)

Test: treehugger
Change-Id: Iddb6cbe67b67b2b10fdd8b5ee654896d23deee47
2023-04-25 17:29:22 -07:00
Treehugger Robot
4d1405e509 Merge "Nullability check for modules in the netinet directory." 2023-04-25 22:35:44 +00:00
Treehugger Robot
7477d79a0f Merge "Add SYS_riscv_flush_icache." 2023-04-25 21:57:38 +00:00
zijunzhao
577177a326 Nullability check for modules in the netinet directory.
Bugs: b/245972273
Test: adb shell
Change-Id: Ia133f55c3e93ae00b605298365f1c00396bcfba7
2023-04-25 20:10:14 +00:00
Elliott Hughes
873c1ca3cb Add SYS_riscv_flush_icache.
Fix the uapi import script to look at the riscv/asm/ directory too, and
re-run it to add the missing SYS_riscv_* entry (there's only this one)
to glibc-syscalls.h.

Test: treehugger
Change-Id: Ie52c6ca1943c05bb615932174e49e7fb79725a7b
2023-04-25 12:13:56 -07:00
Elliott Hughes
a89765bcaa Merge "Fix the hwasan_test copyright header." 2023-04-25 14:27:59 +00:00
Elliott Hughes
88ba3c1af3 Fix the hwasan_test copyright header.
Someone uploaded --no-verify, and now I'm being asked to change the
NOTICE file. Instead, let's just use the existing BSD header for 2023,
since we've been trying to keep the tests BSD licensed anyway.

Test: treehugger
Change-Id: I4a5b1a50c65bebaaa3015634b67868b3b7a7ce32
2023-04-24 17:10:20 -07:00
Treehugger Robot
56f5c04491 Merge "Document a couple of new-in-U features." 2023-04-22 01:55:27 +00:00
Treehugger Robot
d3733e1edd Merge "riscv64: fix the name of Zisslpcfi." 2023-04-22 01:19:29 +00:00