[compiler-rt] f322f4a - [sanitizer_common] Provide dummy ThreadDescriptorSize on Solaris (#109285)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 00:35:32 PDT 2024
Author: Rainer Orth
Date: 2024-09-20T09:35:28+02:00
New Revision: f322f4a55e8a60b996a0a9f0b3fe924c7af2cb1b
URL: https://github.com/llvm/llvm-project/commit/f322f4a55e8a60b996a0a9f0b3fe924c7af2cb1b
DIFF: https://github.com/llvm/llvm-project/commit/f322f4a55e8a60b996a0a9f0b3fe924c7af2cb1b.diff
LOG: [sanitizer_common] Provide dummy ThreadDescriptorSize on Solaris (#109285)
Since 2c69a09bee94acca859a1adf5b04d01dc13f7295, the Solaris build is
broken like
```
Undefined first referenced
symbol in file
_ZN11__sanitizer20ThreadDescriptorSizeEv projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_linux_libcdep.cpp.o
```
The `ThreadDescriptorSize` reference is from
`sanitizer_linux_libcdep.cpp` (`GetTls`), l.590. This isn't actually
needed on non-glibc targets AFAICS, so this patch provides a dummy to
restore the build.
Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index aa156acd7b657a..4fc99197aae3d5 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -226,7 +226,7 @@ static void GetGLibcVersion(int *major, int *minor, int *patch) {
// sizeof(struct pthread) from glibc.
static uptr thread_descriptor_size;
-// FIXME: Implementation is very GLIBC specific, but it's used by FREEBSD.
+// FIXME: Implementation is very GLIBC specific, but it's used by FreeBSD.
static uptr ThreadDescriptorSizeFallback() {
# if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \
SANITIZER_RISCV64
@@ -364,6 +364,7 @@ static uptr TlsPreTcbSize() {
# endif
# else // (SANITIZER_FREEBSD || SANITIZER_GLIBC) && !SANITIZER_GO
void InitTlsSize() {}
+uptr ThreadDescriptorSize() { return 0; }
# endif // (SANITIZER_FREEBSD || SANITIZER_GLIBC) && !SANITIZER_GO
# if (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_SOLARIS) && \
More information about the llvm-commits
mailing list