Commit graph

38090 commits

Author SHA1 Message Date
zijunzhao
1581f63e6d Nullability check for getopt module
Bugs: b/245972273
Test: adb shell
Change-Id: I01cab7eacee486348fd90bd2a0d34c41873c017a
2023-03-13 18:03:29 +00:00
Treehugger Robot
1cccc1a059 Merge "Nullability check for resolv module" 2023-03-11 01:26:13 +00:00
Zijun Zhao
dddea28a74 Merge "Nullability check for thread module" 2023-03-11 01:00:27 +00:00
zijunzhao
e589574d22 Nullability check for thread module
Bugs: b/245972273
Test: adb shell
Change-Id: Id93d0456e063adf0d41483a1f99f66c2d67bd4df
2023-03-10 20:37:27 +00:00
zijunzhao
16c23883bd Nullability check for resolv module
Bugs: b/245972273
Test: adb shell
Change-Id: I3ee948b3c832ece1969453d499e6f5de5d0bd85e
2023-03-10 01:40:04 +00:00
Elliott Hughes
d2e55dd05b Merge "The syscall call uses the 'tail' instruction call" 2023-03-09 22:03:42 +00:00
caowencheng
c42c74138c The syscall call uses the 'tail' instruction call
If the 'j' command is used here,it cannot always be called.
The 'tail' command is used here, let the compiler decide
which instruction to use,when the call distance is less
than 1M, it will be compiled into 'j' command, and when
the distance is greater than 1M, it will be compiled
into 'aupic' and 'jr' command.

Test: llvm-objdump -d
Change-Id: I53d8aa7f54b9c4c96fce491487dcba7b63348219
Signed-off-by: caowencheng <caowencheng@eswincomputing.com>
2023-03-09 07:44:03 +00:00
Zijun Zhao
7f8133dc2f Merge "Nullability check for pidfd module" 2023-03-09 00:06:12 +00:00
Zijun Zhao
85fc6b141e Merge "Nullability check for utsname module" 2023-03-08 23:47:42 +00:00
Zijun Zhao
5bfbc5330f Merge "Nullability check for assert module" 2023-03-08 23:47:30 +00:00
Elliott Hughes
6cb7db2b03 Merge "riscv64: use tail for tail calls." 2023-03-08 21:13:37 +00:00
zijunzhao
edc554dace Nullability check for pidfd module
Bugs: b/245972273
Test: adb shell
Change-Id: I825cd4091f6e9d052a332e91c8b2455dd5c71b01
2023-03-08 21:06:57 +00:00
zijunzhao
f6f0c9dd1b Nullability check for utsname module
Bugs: b/245972273
Test: adb shell
Change-Id: I713c54998ab32e3dc9a6d53fd64523f5fdcbf79a
2023-03-08 21:05:19 +00:00
zijunzhao
698b6160a3 Nullability check for assert module
Bugs: b/245972273
Test: adb shell
Change-Id: Ic682d7bfd1dab53a776bcd783fbff9df07e309f5
2023-03-08 21:02:48 +00:00
Elliott Hughes
b0d3f0bcef riscv64: use tail for tail calls.
Don't assume that a `j` will always be in range. Let the toolchain
come up with the shortest sequence that will actually work.

Test: llvm-objdump -d
Change-Id: I497a68ecae434aad173c2b1c8024aed3756b8440
2023-03-08 18:22:29 +00:00
Treehugger Robot
a7015eaa64 Merge "Fix the compile errors "R_RISCV_JAL out of rang" when the jump range is greater than 1M memory space between vfork and __set_errno_internal" 2023-03-08 18:19:19 +00:00
Treehugger Robot
7f2f9410ab Merge "Nullability check for grp module" 2023-03-08 06:26:15 +00:00
Zijun Zhao
2c445d9979 Merge "Nullability check for stdio module" 2023-03-08 05:16:57 +00:00
caowencheng
d27c83fbd4 Fix the compile errors "R_RISCV_JAL out of rang" when the jump range is greater than 1M memory space between vfork and __set_errno_internal
the "tail" command is used here, let the compiler decide
which instruction to use. when the call distance is less
than 1M, it will be compiled into "jr" command, and when
the distance is greater than 1M, it will be compiled
into "aupic" and "jr" command.

Test: make libc
Change-Id: I80d099d25c7cc2439a297d8afc65abeb5a7a360c
Signed-off-by: caowencheng <caowencheng@eswincomputing.com>
2023-03-08 01:44:50 +00:00
Alistair Delva
78f71a53e5 Merge "Guard registers definitions for riscv64" 2023-03-08 00:55:11 +00:00
zijunzhao
33102fb381 Nullability check for grp module
Bugs: b/245972273
Test: adb shell
Change-Id: Ic45b8ff095f5e388389078b63ac2cd5e745422cf
2023-03-08 00:15:01 +00:00
Nelly Vouzoukidou
1cb31580f8 Guard registers definitions for riscv64
Guarding the definitions of registers with `#if definded(__USE_GNU)`.
This resolves a name conflict with the mesa3d library when
Virgl is enabled.

Test: launch_cvd -console=true -guest_enforce_security=false\
                 --gpu_mode=drm_virgl
Change-Id: I4402500eff74e26343700c099dd397b8a19a5ee3
2023-03-07 17:03:41 +00:00
Elliott Hughes
75a114b0b1 Merge "Sync with upstream openbsd." 2023-03-07 16:48:06 +00:00
Elliott Hughes
b6e7e2c39b Merge "Remove #pragma workarounds for %b/%B." 2023-03-07 16:24:18 +00:00
Elliott Hughes
056ce2eb34 Merge "Add the %b/%B PRI* and SCN* macros." 2023-03-07 16:21:44 +00:00
zijunzhao
00a3dbaab6 Nullability check for stdio module
Bugs: b/245972273
Test: adb shell
Change-Id: I6d1f2afad6ab3f884795a2d33875684a14fe54d6
2023-03-07 01:07:19 +00:00
Elliott Hughes
53b6dfbc64 Sync with upstream openbsd.
Upstream made a change similar to our %s change, so we don't need that
difference any more. (But they didn't seem interested in our GNU
extensions, even though they're sensible ones that just ensure symmetry
between strftime() and strptime().)

Bug: http://b/167569813
Test: treehugger
Change-Id: I1d86d69c87b51719f0583341fafa7802869cd37e
2023-03-06 23:32:48 +00:00
Elliott Hughes
6f231ce503 Remove #pragma workarounds for %b/%B.
We have a new enough clang now that it knows about %b/%B.

Test: treehugger
Change-Id: I92f21e3bebdd652a4826ce8caa33400c3e3db72f
2023-03-06 23:30:12 +00:00
Elliott Hughes
ac34ad2ae6 Add the %b/%B PRI* and SCN* macros.
This was a suggested change:

https://open-std.org/JTC1/SC22/WG14/www/docs/n3072.htm#pri-and-scn-macros-are-missing-for-new-format-specifiers

That has been accepted, but at the time of writing, there isn't yet
a new PDF that includes the changes.

Test: treehugger
Change-Id: If7b68d246561716465e937a7d2c7482d2c739ce7
2023-03-06 21:41:54 +00:00
Elliott Hughes
529c16a678 Merge "memset_chk into assembly file" 2023-03-06 20:53:36 +00:00
Florian Mayer
ee824ae6e0 Merge "add test for using malloced stack for pthread_create" 2023-03-06 20:52:25 +00:00
Elliott Hughes
793d272b43 Merge "Slightly simplify perror()." 2023-03-06 17:03:39 +00:00
caowencheng
ab457f9022 memset_chk into assembly file
Writing an assembly file can reduce several
assembly instructions, and compare it through
the disassembly of this file

Test: make libc
Change-Id: Ifdcc9c76742cc95b2ad9e3c14fac4796c36e12e6
Signed-off-by: caowencheng <caowencheng@eswincomputing.com>
2023-03-06 07:23:10 +00:00
Elliott Hughes
ae1c64ac92 Slightly simplify perror().
Using %m is slightly less code, and means that perror() wouldn't touch
the strerror buffer in TLS. Doesn't matter, but noticed while I was
looking at this for another reason, and since it's _less_ code...

Test: treehugger
Change-Id: I99d31a5c326962958ad843ec4da2c3cc3b93b048
2023-03-03 23:46:34 +00:00
Christopher Ferris
90dd5f0fd1 Merge "Don't run GWP ASan integration tests under HWASan." 2023-03-03 01:48:58 +00:00
Elliott Hughes
8dd531cef9 Merge "Remove #if cruft." 2023-03-02 23:55:45 +00:00
Florian Mayer
f966620ca0 add test for using malloced stack for pthread_create
Bug: 148982147
Change-Id: I65e284a083236f1a552fb1e2fefe1c268ed2ecc3
2023-03-02 15:34:10 -08:00
Christopher Ferris
92a4d2bcee Don't run GWP ASan integration tests under HWASan.
Bug: 267386540

Test: All unit tests pass on normal build.
Test: All GWP ASan tests are skipped under hwasan.
Change-Id: I6d6860090b62e7187cf947de0a9bc30d00330554
2023-03-02 21:57:12 +00:00
Elliott Hughes
dc3ed4f164 Merge "Pull flockfile/funlockfile/ftrylockfile into stdio.cpp." 2023-03-02 21:24:19 +00:00
Elliott Hughes
20dd3fed7a Pull flockfile/funlockfile/ftrylockfile into stdio.cpp.
These are just one-liners, and the _FLOCK() macro seemed to me more
obscure than just inlining it (especially because there are only four
call sites total, so it's not like anyone's going to see that macro very
often).

Also add the missing CHECK_FP() calls. I don't expect this to break
anything, but if it does we can add a target API level check.

Test: treehugger
Change-Id: Ifa1a39d5d9eee46cca783acbe9ec3b3a1e6283d9
2023-03-02 01:44:54 +00:00
Zijun Zhao
6bda367899 Merge "Nullability check for dlfcn module" 2023-03-02 00:32:47 +00:00
Treehugger Robot
f7c2b8c2a6 Merge "Disable elftls_dl#dtv_resize on HWASan" 2023-03-02 00:05:30 +00:00
Florian Mayer
2b67014e11 Disable elftls_dl#dtv_resize on HWASan
A new TLS variable was added to HWASan RT in the new toolchain and
this tests needs to be adjusted. Skipping for now.

Bug: 271243811
Change-Id: Ie6664a9ac350624e8e963a36e4248d0d051bc8c1
2023-03-01 21:40:17 +00:00
zijunzhao
447c346475 Nullability check for dlfcn module
Bugs: b/245972273
Test: adb shell
Change-Id: I0ecde8a0f1f71b6ec2262ff637d33c518578d54d
2023-03-01 21:29:41 +00:00
Elliott Hughes
5ee6292872 Remove #if cruft.
There's negative value to explicitly calling out Linux and ELF here,
when Android -- and especially this project -- is always both anyway.

No functional change.

Test: treehugger
Change-Id: Ic7514d74a5b5f6f06e64c46486c12773995076cd
2023-03-01 20:26:41 +00:00
Treehugger Robot
c920ac5695 Merge "Nullability check for ifaddrs module" 2023-03-01 10:28:33 +00:00
zijunzhao
e7d41ab7c0 Nullability check for ifaddrs module
Bugs: b/245972273
Test: adb shell
Change-Id: Iccb419667282922d31e2c81b3d9dbac8b6009a76
2023-03-01 01:36:30 +00:00
Elliott Hughes
93398b1b14 Merge "Remove <pthread.h> cruft." 2023-02-28 16:27:57 +00:00
Treehugger Robot
62e24fd016 Merge "Nullability check for stdio_ext module" 2023-02-28 01:48:21 +00:00
zijunzhao
6b6d51e9ea Nullability check for stdio_ext module
Bugs: b/245972273
Test: adb shell
Change-Id: I4175218f6fa7f4581a739bb0f12cf10b6bdb529e
2023-02-27 23:34:25 +00:00