Commit graph

38589 commits

Author SHA1 Message Date
Elliott Hughes
9cf6036048 <fenv.h>: documentation, and __INTRODUCED_IN removal.
Now the NDK doesn't support API levels below 21, we don't actually need
the different arm32 vs x86 annotations. In general we haven't been
removing this historical information because it might be interesting to
someone, and there's no real reason to remove it, but we've had
versioner bugs recently with these more complex cases.

Test: treehugger
Change-Id: I9460109a2648b9d05d7e21e397935293d3fea8eb
2023-06-06 20:32:12 +00:00
Treehugger Robot
374d2f1be0 Merge "Nullability check for shm module." 2023-05-23 22:01:02 +00:00
zijunzhao
969d6c129a Nullability check for shm module.
Bugs: b/245972273
Test: adb shell
Change-Id: I9bdd5727719311d063fa126fc286618e9d24a45b
2023-05-23 19:15:25 +00:00
Elliott Hughes
3285ae5a4d Merge "Fix the *return* types in the arm64 dynamic function dispatch." 2023-05-23 13:46:30 +00:00
Treehugger Robot
0f371ff845 Merge "Nullability check for xattr module." 2023-05-22 20:46:30 +00:00
Elliott Hughes
20f9d67327 Fix the *return* types in the arm64 dynamic function dispatch.
No actual effect on the code, but misleading and wrong. (The previous
change only fixed the argument types; I didn't notice that some of the
return types were wrong too.)

Test: treehugger
Change-Id: I1ee5c48e2652fd8cbf8178d5659e57f79e61898e
2023-05-22 19:28:33 +00:00
zijunzhao
9f6b4caa9e Nullability check for xattr module.
Bugs: b/245972273
Test: adb shell
Change-Id: I0137c86f3fa7e17fb5fe284c7693315b2df1e2db
2023-05-22 18:31:16 +00:00
Treehugger Robot
c044d3afeb Merge "time.mktime_EOVERFLOW: set an explicit timezone." 2023-05-20 01:35:47 +00:00
Elliott Hughes
f52b2165cb time.mktime_EOVERFLOW: set an explicit timezone.
Bug: http://b/283397453
Test: export TZ=Asia/Shanghai
Change-Id: Ia03822adad367abf35a0fdf55d7367cd1764fcdd
2023-05-19 16:09:47 -07:00
Ryan Prichard
e98bf160eb Merge "Fixes for versioner guard generation" 2023-05-19 22:25:44 +00:00
Elliott Hughes
01db121db5 Merge "Fix the types in the arm64 dynamic function dispatch." 2023-05-19 14:15:53 +00:00
Ryan Prichard
4690f0756d Fixes for versioner guard generation
* When calculating the required guard, if a per-arch `introduced`
   value is less than the arch min-API, drop the per-arch guard (i.e.
   reset the value to 0). This is needed for RISC-V, where we don't
   parse the headers with Clang, because the highest APIs we compile
   for (e.g. 23, 34) are less than the current RISC-V min API of 10000.
   Resetting it to 0 here means we don't need this optimization while
   generating an arch-set guard. (i.e. We don't need to calculate
   max_min_version. That code should have been calculating a
   "min_min_version" anyway.)

 * Remove the broken all-supported-archs entry from arch_sets. It has a
   few problems:
    * It's redundant with the "global availability" code path above,
      which is used when the declaration has no per-arch annotations.
    * If this code path runs, then we generate two more guard
      expressions, for !LP64 and LP64.
    * Passing "" to generate_guard is broken for a non-zero version,
      and for a zero version, adding an empty string to `expressions`
      breaks if the vector has 2 or more expressions.

   (I think consolidating per-arch info, e.g. using a single check for
   __INTRODUCED_IN_32(40) __INTRODUCED_IN_64(40), is a nice idea, but
   it should happen as a natural consequence of removing the
   arch-independent "global availability" info in favor of always
   tracking it per-arch.)

 * Rewrite the arch-set guard generation. Add an optimization so that
   the (__ANDROID_API__ >= N) guard for __INTRODUCED_IN_64(N) is still
   useful for RISC-V as long as N is small enough. (Currently we're
   checking that N is <= 10000.)

This change fixes the "preprocessor" test that run_tests.py runs. The
"slow_preprocessor_idempotence" test is still broken.

Bug: https://github.com/android/ndk/issues/1888
Test: run_tests.py
Change-Id: I3f94357465dbdb2c23fff442a31fb5083de27a97
2023-05-18 21:11:43 -07:00
Zijun Zhao
b72900c5c9 Merge "Nullability check for mman module." 2023-05-18 23:46:06 +00:00
Elliott Hughes
a1974064ae Fix the types in the arm64 dynamic function dispatch.
No actually effect on the code, but misleading and wrong.

Test: treehugger
Change-Id: I55405ac224b4dcc2ae515954aed179c1cde3c73c
2023-05-18 13:40:12 -07:00
Treehugger Robot
1441748956 Merge "Clarify the defines documentation further." 2023-05-18 20:03:56 +00:00
zijunzhao
2572571786 Nullability check for mman module.
Bugs: b/245972273
Test: adb shell
Change-Id: Ib5c4887d89581eaedcf4a3e128811a6a374a8d1b
2023-05-18 19:02:25 +00:00
Treehugger Robot
83f9b28792 Merge "Nullability check for system_properties module." 2023-05-18 18:38:17 +00:00
Christopher Ferris
3cf1f484b1 Merge "Use AndroidLocalUnwinder object." 2023-05-18 18:24:58 +00:00
Elliott Hughes
2b9ae05bee Clarify the defines documentation further.
At least one person wasn't entirely convinced by our existing riscv64
documentation, and there was an error in the 32 vs 64 section.

Test: N/A
Change-Id: Iaa08b8f4b5a5506a4ade15f81e17325185036a07
2023-05-18 17:10:37 +00:00
Christopher Ferris
e2f58a3f03 Use AndroidLocalUnwinder object.
Using the AndroidLocalUnwinder object allows unwinding interpreter
and JIT'd frames by default. In addition, it simplifies the code.

Test: Forced interpreter on all of the time and forced fdtrack on
Test: and verified unwind includes dex frames.
Test: Forced JIT on all of the time and forced fdtrack on
Test: and verified unwind includes dex frames.
Test: Unit tests pass.
Change-Id: Icae17e83c9aaa04750b07471243550a7829524f7
2023-05-17 18:45:25 -07:00
Florian Mayer
e20c5fa4ac Merge "Revert "Add debug logging for memtag level"" 2023-05-18 01:06:23 +00:00
Florian Mayer
dd44378da7 Revert "Add debug logging for memtag level"
This reverts commit b3f3e86878.

Reason for revert: This created spam in tombstones.

Change-Id: Ia7b8285a6abd6f89d49859a981be1c9cfa104f81
2023-05-17 20:59:14 +00:00
zijunzhao
a505b2d37a Nullability check for system_properties module.
Bug: b/245972273
Test: adb shell
Change-Id: I3a55b8107898014fe74fd1a6f442f1ec00e08790
2023-05-17 20:43:51 +00:00
Treehugger Robot
ad333b6161 Merge "riscv64: say "x3" rather than "gp" in shadow call stack assembler." 2023-05-17 16:51:16 +00:00
Elliott Hughes
c35a0dc08e riscv64: say "x3" rather than "gp" in shadow call stack assembler.
Neither is great, but "gp" seems actively misleading (and setjmp.S
says x3 every time, so we should be consistent if nothing else).

Bug: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/379
Test: treehugger
Change-Id: Ibccda74d4794caa770b82e7ba2e31ce7b645b83f
2023-05-16 16:09:30 -07:00
Treehugger Robot
b167b90b4c Merge "Nullability check for time module." 2023-05-16 18:28:57 +00:00
zijunzhao
2067ec5967 Nullability check for time module.
Bug: b/245972273
Test: adb shell
Change-Id: I61f69f48f3428ef1f544dd01e573ff078a9eab17
2023-05-16 00:17:36 +00:00
Elliott Hughes
d93f594d78 Merge "riscv64: don't use jalr when we can just say call." 2023-05-12 22:45:19 +00:00
Elliott Hughes
a198c71752 Merge "printf unification: floating point." 2023-05-12 20:15:02 +00:00
Elliott Hughes
1bfe534274 riscv64: don't use jalr when we can just say call.
We don't actually care about the length of this jump, and lld will relax
it to a jal when possible anyway. Better to have people copy & paste
call and tail than jal and j.

Test: treehugger
Change-Id: I889044b95fbb5567189a0d6ef31f81df0e0383cd
2023-05-12 12:56:54 -07:00
Shreshta Manu
56dba096a2 Merge "Revert "Nullability check for inet module."" 2023-05-12 18:20:56 +00:00
Zijun Zhao
07a2b29dd6 Revert "Nullability check for inet module."
This reverts commit 53dbd78ae0.

Reason for revert: Break build https://android-build.googleplex.com/builds/submitted/10125312/test_suites_x86_64_coverage/latest/view/logs/build_error.log?legacy

Change-Id: Ifccf22768b916d85263abb89b2b4223ae2ce5d80
2023-05-12 18:18:29 +00:00
Zijun Zhao
50d729b228 Merge "Nullability check for inet module." 2023-05-12 17:17:48 +00:00
Zijun Zhao
8e5e8ee14b Merge "Nullability check for if module." 2023-05-12 17:17:23 +00:00
Zijun Zhao
78b0558976 Merge "Nullability check for netdb module" 2023-05-12 00:21:24 +00:00
Elliott Hughes
531199c56c printf unification: floating point.
The only remaining differences between vfprintf.cpp and vfwprintf.cpp
after this are the wide/narrow conversions for %c, %m, and %s. I've used
"chars" and "bytes" for the named constants for the directions because
(a) I find -1 and 1 pretty confusing and (b) although "narrow" is the
obvious opposite of "wide", only Windows actually moved to wide
characters, so "narrow" (aka "multibyte", and probably "utf8") is the
default/normal case. Even though C confuses bytes and characters via its
`char` type, "bytes" versus "chars" seems like the appropriate
terminology (and it's what Java/Python use).

Also improve the swprintf tests assertion so failures are readable.

Test: treehugger
Change-Id: Ife8f70f65ec28d96058a7d68df353945524835d2
2023-05-11 16:51:13 -07:00
zijunzhao
53dbd78ae0 Nullability check for inet module.
Bugs: b/245972273
Test: adb shell
Change-Id: I51830ddbf5ceb7c02154bd335feb65ca1a230b66
2023-05-11 22:57:27 +00:00
zijunzhao
c741aea751 Nullability check for netdb module
Bugs: b/245972273
Test: adb shell
Change-Id: Id9b4338ca2f0fb64033c221f3bfb269ab930b79b
2023-05-11 21:31:42 +00:00
Elliott Hughes
0824e2cb84 Merge "riscv64: fix return value when errorno is 4095" 2023-05-11 17:58:00 +00:00
zijunzhao
87aae5309b Nullability check for if module.
Bugs: b/245972273
Test: adb shell
Change-Id: If6be7027e0ebdcf68ae4062c57e1c4e82a767abe
2023-05-11 17:15:57 +00:00
Mao Han
d4e662edab riscv64: fix return value when errorno is 4095
This issue was discovered by seccomp_seccomp_bpf_riscv_64 test.
Actual output:
[0]code=20 jt=00 jf=00 k=0000
[1]code=15 jt=00 jf=01 k=003F
[2]code=06 jt=00 jf=00 k=51000
[3]code=06 jt=00 jf=00 k=7FFF0000
ret=-4095, errno=0

Expected output:
[o]code=20 jt=00 jf=00 k=0000
[1]code=15 jt=00 jf=01 k=003F
[2]code=06 jt=00 jf=00 k=51000
[3]code=06 jt=00 jf=00 k=7FFF0000
ret=-1, errno=4095

Change-Id: Ieebf5f0d1e2f18e2887c463b58ef7ea05ea52898
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Signed-off-by: haocheng.zy <zhangye@linux.alibaba.com>
2023-05-11 14:52:56 +08:00
Christopher Ferris
983292a972 Merge "Update to v6.3 kernel headers." 2023-05-10 23:28:53 +00:00
Treehugger Robot
d9fa32e99f Merge "More printf unification: FLUSH()." 2023-05-09 21:46:12 +00:00
Christopher Ferris
b7cef6d910 Update to v6.3 kernel headers.
Kernel headers coming from:

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

Test: Bionic unit tests pass.
Change-Id: I5270ef291a77343e47ef3a5fbd02b8cacf218ec5
2023-05-09 19:04:15 +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