llvm-project/compiler-rt/lib
Fangrui Song 031c40dc3c [sanitizer] Fix glibc sparc build and add GetTls support
sanitizer_linux_libcdep.cpp doesn't build for Linux sparc (with minimum support
but can build) after D98926. I wasn't aware because the file didn't mention
`__sparc__`.

While here, add the relevant support since it does not add complexity
(the D99566 approach).  Adds an explicit `#error` for unsupported
non-Android Linux and FreeBSD architectures.

ThreadDescriptorSize is only used by lsan to scan thread-specific data keys in
the thread control block.

On TLS Variant II architectures (i386/x86_64/s390/sparc), our dl_iterate_phdr
based approach can cover the region from the first byte of the static TLS block
(static TLS surplus) to the thread pointer.
We just need to extend the range to include the first few members of struct
pthread. offsetof(struct pthread, specific_used) satisfies the requirement and
has not changed since 2007-05-10. We don't need to update ThreadDescriptorSize
for each glibc version.

Technically we could use the 524/1552 for x86_64 as well but there is potential
risk that large applications with thousands of shared object dependency may
dislike the time complexity increase if there are many threads, so I don't make
the simplification for now.

Differential Revision: https://reviews.llvm.org/D100892
2021-04-20 17:42:41 -07:00
..
BlocksRuntime
asan Fix android-x86 library name in asan_device_setup. 2021-04-19 17:39:58 -07:00
builtins [Sanitizers] DragonFlyBSD adding support for builtins 2021-04-17 11:10:35 +01:00
cfi [sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks 2020-09-08 10:12:05 -07:00
crt [RISCV][crt] support building without init_array 2020-12-01 17:17:50 +03:00
dfsan [dfsan] Set sigemptyset's return label to be 0 2021-03-31 21:07:44 +00:00
fuzzer [fuzzer] Print reloaded file paths 2021-04-16 10:00:24 -07:00
gwp_asan [GWP-ASan] Change sys/cdefs.h to features.h 2021-02-17 20:03:16 -08:00
hwasan [hwasan] Fix lock contention on thread creation. 2021-04-14 17:13:15 -07:00
interception [sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature detection and support musl 2021-01-06 10:55:40 -08:00
lsan Revert "[sanitizer] Simplify GetTls with dl_iterate_phdr on Linux" 2021-04-05 19:00:18 -04:00
memprof Revert "[sanitizer] Simplify GetTls with dl_iterate_phdr on Linux" 2021-04-05 19:00:18 -04:00
msan Revert "[sanitizer] Simplify GetTls with dl_iterate_phdr on Linux" 2021-04-05 19:00:18 -04:00
profile [gcov] Delete ancient MSVC workaround 2021-03-12 15:10:12 -08:00
safestack compiler-rt: Rename .cc file in lib/{interception/tests,safestack} to .cpp 2019-08-01 13:56:52 +00:00
sanitizer_common [sanitizer] Fix glibc sparc build and add GetTls support 2021-04-20 17:42:41 -07:00
scudo [scudo][standalone] Fuchsia related fixes 2021-04-15 13:26:23 -07:00
stats compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
tsan [sanitizer] Simplify GetTls with dl_iterate_phdr on Linux and use it on musl/FreeBSD 2021-04-15 15:34:43 -07:00
ubsan [Sanitizers] Fix build 2021-04-17 11:15:31 +01:00
ubsan_minimal [compiler-rt] Suppress -Wunused-result due to ::write when _FORTIFY_SOURCE>0 in glibc 2020-10-12 09:57:12 -07:00
xray [XRay][compiler-rt][x86_64] Fix CFI directives in assembly trampolines 2021-03-06 10:38:27 -08:00
CMakeLists.txt [MemProf] Decouple memprof build from COMPILER_RT_BUILD_SANITIZERS 2020-10-26 13:52:50 -07:00