Skip to content

Commit 67d7903

Browse files
[Bazel] Define BUILTIN_THREAD_POINTER where appropriate on x86-64 linux (#74574)
This patch defines BUILTIN_THREAD_POINTER in config.bzl when appropriate on x86-64 linux only. This is needed to build exegesis properly as certain functionality breaks if this is not enabled. This option is only supported on relatively recent compiler versions, but given most people using the bazel build are using very recent toolchains, this shouldn't be an issue.
1 parent eb05d7a commit 67d7903

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

utils/bazel/llvm-project-overlay/llvm/config.bzl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,17 @@ os_defines = select({
8686
"//conditions:default": linux_defines,
8787
})
8888

89+
# HAVE_BUILTIN_THREAD_POINTER is true for on Linux (outside of ppc64) for
90+
# all recent toolchains. Add it here by default on Linux as we can't perform a
91+
# configure time check.
92+
builtin_thread_pointer = select({
93+
"@bazel_tools//src/conditions:linux_ppc64le": [],
94+
"@bazel_tools//src/conditions:linux": ["HAVE_BUILTIN_THREAD_POINTER"],
95+
"//conditions:default": [],
96+
})
97+
8998
# TODO: We should split out host vs. target here.
90-
llvm_config_defines = os_defines + select({
99+
llvm_config_defines = os_defines + builtin_thread_pointer + select({
91100
"@bazel_tools//src/conditions:windows": native_arch_defines("X86", "x86_64-pc-win32"),
92101
"@bazel_tools//src/conditions:darwin_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"),
93102
"@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"),

0 commit comments

Comments
 (0)