PR #1915: Fix SYCL Build Compatibility with Intel LLVM Compiler on Windows for abseil Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1915 Add platform-specific thread-local storage definition for Intel's LLVM compiler when building with SYCL. The Intel LLVM compiler (icx) with SYCL enabled requires GCC-style thread-local storage (__thread) rather than Windows-specific __declspec(thread) when compiling for SYCL device code. This resolves the build error: "thread-local storage is not supported for the current target" when building with Intel oneAPI env on Windows systems. Merge 2596bc81e19f8799cf92bd5d36d78aacb0afc9cd into e5266cd1cdd21481209cd55ba7f6698b5fe1bd6b Merging this change closes #1915 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1915 from ContradNamiseb:patch-1 2596bc81e19f8799cf92bd5d36d78aacb0afc9cd PiperOrigin-RevId: 792213053 Change-Id: Ib53808f0c604749e00ae3da4c9070ab21e19c8d4
diff --git a/absl/base/config.h b/absl/base/config.h index f3cafbd..b1c5227 100644 --- a/absl/base/config.h +++ b/absl/base/config.h
@@ -237,6 +237,8 @@ #error ABSL_HAVE_TLS cannot be directly set #elif (defined(__linux__)) && (defined(__clang__) || defined(_GLIBCXX_HAVE_TLS)) #define ABSL_HAVE_TLS 1 +#elif defined(__INTEL_LLVM_COMPILER) +#define ABSL_HAVE_TLS 1 #endif // ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE