[clang] [llvm] [clang-repl] Add CLANG_ENABLE_EMUTLS_GET_ADDRESS cmake option (PR #217700)

Pranav Kant via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 12:54:31 PDT 2026


================
@@ -220,6 +220,14 @@ if( CLANG_HAVE_DLFCN_H )
   cmake_pop_check_state()
 endif()
 
+include(CheckCXXSourceCompiles)
+check_cxx_source_compiles("
+  extern \"C\" void *__emutls_get_address(void *);
+  int main() {
+    return __emutls_get_address((void *)0) != (void *)0;
+  }
+" CLANG_HAVE_EMUTLS_GET_ADDRESS)
----------------
pranavk wrote:

For context, this is trying to fix https://github.com/llvm/llvm-project/pull/209717 which requires __emutls_get_address to be available at link time.

This PR is trying to move all that logic into cmake configure time.

There was another version of this PR that didn't have this check and just required explicitly setting -DCLANG_HAVE_EMUTLS_GET_ADDRESS= but @vgvassilev wanted to see if we could get that auto set during configure time

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


More information about the cfe-commits mailing list