Skip to content

Commit f322f4a

Browse files
authored
[sanitizer_common] Provide dummy ThreadDescriptorSize on Solaris (#109285)
Since 2c69a09, 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`.
1 parent 96ae7c4 commit f322f4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static void GetGLibcVersion(int *major, int *minor, int *patch) {
226226
// sizeof(struct pthread) from glibc.
227227
static uptr thread_descriptor_size;
228228

229-
// FIXME: Implementation is very GLIBC specific, but it's used by FREEBSD.
229+
// FIXME: Implementation is very GLIBC specific, but it's used by FreeBSD.
230230
static uptr ThreadDescriptorSizeFallback() {
231231
# if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \
232232
SANITIZER_RISCV64
@@ -364,6 +364,7 @@ static uptr TlsPreTcbSize() {
364364
# endif
365365
# else // (SANITIZER_FREEBSD || SANITIZER_GLIBC) && !SANITIZER_GO
366366
void InitTlsSize() {}
367+
uptr ThreadDescriptorSize() { return 0; }
367368
# endif // (SANITIZER_FREEBSD || SANITIZER_GLIBC) && !SANITIZER_GO
368369

369370
# if (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_SOLARIS) && \

0 commit comments

Comments
 (0)