[clang] [llvm] [ORC] Track __emutls_t definitions in IRMaterializationUnit (PR #207161)

Emery Conrad via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 02:32:13 PDT 2026


conrade-ctc wrote:

> @mizvekov @cofibrant thanks for the revert!
> 
> @conrade-ctc @vgvassilev I just took a look locally -- `__emutls_get_address` is implemented In the compiler-rt builtins library, which clang-repl doesn't link by default. I think that this fix in this patch is correct, but to make the testcase (and thread locals in general) work on Darwin your options are: (1) add the compiler-rt builtins library to the Platform JITDylib (so that __emutls_get_addr can be found that way), (2) add an absolute symbol for `__emutls_get_addr` in libClangInterpreter (this will force `__emutls_get_addr` to be linked into the clang library), or (3) use native TLS on Darwin (you'd need to also link the ORC runtime).

Ya, makes sense. The absolute symbol pathway is the smallest scope/targeted approach I think. I'll put up a new PR with an update along those lines and tag you so you can review to make sure it makes sense to you. Thanks for the pointer @lhames 

https://github.com/llvm/llvm-project/pull/207161


More information about the cfe-commits mailing list