[PATCH] D120059: [sanitizer_common] Support Solaris < 11.4 in GetStaticTlsBoundary

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 21:30:52 PST 2022


MaskRay added a comment.

In D120059#3330715 <https://reviews.llvm.org/D120059#3330715>, @ro wrote:

> In D120059#3330523 <https://reviews.llvm.org/D120059#3330523>, @MaskRay wrote:
>
>> 
>
>
>
>> Oh, thanks. Then perhaps adjust the code to work for Solaris 11.4 and let Illumos/Solaris 11.3 use the `*addr = 0; *size = 0;` fallback? That will have minimum code...
>
> That would effectively mean using D120048 <https://reviews.llvm.org/D120048> amended to use some `SANITIZER_ILLUMOS` to distinguish the two.  Currently, we don't have that unfortunately, as discussed in D119695 <https://reviews.llvm.org/D119695>.  We'd also need to disable the `ld -z relax=transtls` workaround in that patch, but haven't a way to distinguish Solaris and Illumos in `cmake` files either.
>
> I have an idea how to get `__illumos__` defined (using `uname -o` in `llvm/CMakeLists.txt`) to handle the former, but in the end the Illumos community will have to come up with a solution that works for both Solaris and Illumos.
>
>> I hope we can get rid of `main_tls_modid = 1;` and `rt_tlsmodid`...
>
> Fully agreed that's ugly, but at least it works for everyone and has been proven so in GCC.  I'm certainly not vested in it, though, given that I primarily care about Solaris 11.4 where the common code just works.

Glad to know what you only care about Solaris>=11.4:)
It seems that D84046 <https://reviews.llvm.org/D84046> is the first compiler-rt commit with `llumos` in the description. So I think compiler-rt has never officially supported illumnos. 
Perhaps we should ask them to fix things before adding workarounds to compiler-rt?
Perhaps we can set up a milestone: they need to at least `__illumos__` and `dlpi_tls_modid` before adding the port to compiler-rt...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120059



More information about the llvm-commits mailing list