Skip to content

Commit

Permalink
[sanitizer_common] Provide dummy ThreadDescriptorSize on Solaris (#10…
Browse files Browse the repository at this point in the history
…9285)

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`.
  • Loading branch information
rorth committed Sep 20, 2024
1 parent 96ae7c4 commit f322f4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) && \
Expand Down

0 comments on commit f322f4a

Please sign in to comment.