[all-commits] [llvm/llvm-project] 3c138b: Reland "[ORC] Track __emutls_t definitions in IRMa...

Emery Conrad via All-commits all-commits at lists.llvm.org
Thu Jul 9 22:28:54 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3c138b5c5958dce2daefa923a1cae612e47a4273
      https://github.com/llvm/llvm-project/commit/3c138b5c5958dce2daefa923a1cae612e47a4273
  Author: Emery Conrad <conrade.ctc at gmail.com>
  Date:   2026-07-10 (Fri, 10 Jul 2026)

  Changed paths:
    M clang/lib/Interpreter/IncrementalExecutor.cpp
    A clang/test/Interpreter/emulated-tls.cpp
    M llvm/lib/ExecutionEngine/Orc/Layer.cpp

  Log Message:
  -----------
  Reland "[ORC] Track __emutls_t definitions in IRMaterializationUnit" (#207161) (#208413)

Relands #207161, which was reverted in #207775 after the new
`clang/test/Interpreter/emulated-tls.cpp` failed on Darwin with `Symbols
not found: [ ___emutls_get_address ]`.

The `IRMaterializationUnit` fix and the test are unchanged from #207161.
What the failure exposed is that thread_locals never worked in
clang-repl on Darwin: `__emutls_get_address` is implemented in the
compiler-rt builtins static archive, and nothing links it into the
process, so process-symbol lookup cannot resolve it (on Linux it
resolves from `libgcc_s.so`).

New in this reland, per @lhames's suggestion (option 2) on the original
PR:

- `clang/lib/Interpreter/IncrementalExecutor.cpp`: on `__APPLE__`,
reference `__emutls_get_address` (forcing the builtins archive member to
be linked in) and define it as an absolute symbol in the process-symbols
JITDylib, following the precedent of the MinGW `__main` workaround in
`lli.cpp`. Scoped to the default in-process JITBuilder path only — the
host address would be meaningless for an out-of-process executor, and
custom-builder clients do their own setup.

Verified on an aarch64-darwin machine: the previously failing test now
passes, along with the rest of `clang/test/Interpreter`.

@vgvassilev @lhames — could you take a look?

🤖 Done with the help of [Claude Code](https://claude.com/claude-code)
(Claude Opus 4.8, human in the loop)

Co-authored-by: Emery Conrad <emery.conrad at chicagotrading.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list