[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

Rainer Orth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 15 02:38:47 PST 2022


ro added a comment.

In D91605#3321554 <https://reviews.llvm.org/D91605#3321554>, @MaskRay wrote:

> `GetTls` is about the static TLS block size. It consists of the main executable's TLS, and initially loaded shared objects' TLS, `struct pthread`, and padding.
> Solaris should be able to just use the code path like FreeBSD, Linux musl, and various unpopular architectures of Linux glibc:
>
>   #elif SANITIZER_FREEBSD || SANITIZER_LINUX
>     uptr align;
>     GetStaticTlsBoundary(addr, size, &align);

Not unconditionally, unfortunally: as the comment above `GetSizeFromHdr` explains, `dlpi_tls_modid` was only introduced in an update to Solaris 11.4 FCS (which is sort of a problem), but isn't present in 11.3 (don't reallly care) and Illumos (this would break compilation for them).  OTOH my solution is successfully being used in GCC's `libphobos` on Solaris 11.3, 11.4, and most likely Illumos, too.  I'd rather not burn the Illumos bridge if it can be avoided.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91605/new/

https://reviews.llvm.org/D91605



More information about the cfe-commits mailing list