As discussed earlier in the GitHub issue, currently LLVM generates invalid code when emulated TLS is used. There were attempts to resolve this previously (D102527), but they were not merged because the component owners raised concerns about emulated TLS efficiency.
The current state of the art is that:
- OpenBSD team, which raised the initial issue, simply has patches downstream.
- Our team, which raised the GH issue, has patches downstream as well. We also do not use malloc or any dynamic allocations with emulated TLS, so the concerns raised in the original issue does not apply to us.
- GCC compatibility is broken, because GCC supports emulated TLS.
- RISC-V is the only architecture in LLVM that does not support emulated TLS, and work is being done to at least warn the users about it (D143619).
With all these in mind I believe it is important to address the consumers' needs especially given that there is little to no maintenance downsides.
Hoist N instead