Commit graph

38598 commits

Author SHA1 Message Date
Christopher Ferris
185103af60 Merge "Fix benchmark unit tests." 2023-05-26 20:12:13 +00:00
Treehugger Robot
32ce2d5c82 Merge "time.h: add doc comments." 2023-05-26 20:11:05 +00:00
Elliott Hughes
d192dbecf0 time.h: add doc comments.
C23 adds timegm(), gmtime_r(), and localtime_r(). We should remove the
"non-standard" text for timegm(), and while I'm here, let's just
document everything in this file.

Test: treehugger
Change-Id: Ia44c1bd155c939f694f6f8138b9cb7503519522c
2023-05-26 09:13:41 -07:00
Christopher Ferris
80b551ddc4 Fix benchmark unit tests.
Add benchmark file dependency in tests instead of using hard-coded
path to bionic-benchmarks.

In addition, add a TEST_MAPPING file so the tests run when benchmark files change.

Test: All unit tests pass.
Test: Ran atest bionic-benchmarks-tests.
Change-Id: I95608f5b5e75d9d74930960a2431c9896b621ce8
2023-05-26 01:20:56 -07:00
Treehugger Robot
0d522dedc9 Merge "Nullability check for nameser module." 2023-05-26 00:18:02 +00:00
zijunzhao
c412f654c5 Nullability check for nameser module.
Bugs: b/245972273
Test: adb shell
Change-Id: I96a4616d1a758d0f04af5d7f0fb8a0206f068b6a
2023-05-25 21:47:11 +00:00
Treehugger Robot
2b12a6ed5f Merge "Nullability check for inet module." 2023-05-25 00:58:10 +00:00
zijunzhao
bf627f4292 Nullability check for inet module.
Bugs: b/245972273
Test: adb shell
Change-Id: I5acb1910f25dc025e1c8924ebf8b6801503f5161
2023-05-24 22:02:49 +00:00
Treehugger Robot
0122e010a9 Merge "static_assert is a keyword in C23." 2023-05-24 18:55:59 +00:00
Elliott Hughes
525761fd7d static_assert is a keyword in C23.
Test: treehugger
Change-Id: I4eba529475b6255bef1af558f54c373aad8737d0
2023-05-24 08:48:42 -07: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