Skip to content

[Bazel] Define BUILTIN_THREAD_POINTER where appropriate on x86-64 linux #74574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion utils/bazel/llvm-project-overlay/llvm/config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,17 @@ os_defines = select({
"//conditions:default": linux_defines,
})

# HAVE_BUILTIN_THREAD_POINTER is true for on Linux (outside of ppc64) for
# all recent toolchains. Add it here by default on Linux as we can't perform a
# configure time check.
builtin_thread_pointer = select({
"@bazel_tools//src/conditions:linux_ppc64le": [],
"@bazel_tools//src/conditions:linux": ["HAVE_BUILTIN_THREAD_POINTER"],
"//conditions:default": [],
})

# TODO: We should split out host vs. target here.
llvm_config_defines = os_defines + select({
llvm_config_defines = os_defines + builtin_thread_pointer + select({
"@bazel_tools//src/conditions:windows": native_arch_defines("X86", "x86_64-pc-win32"),
"@bazel_tools//src/conditions:darwin_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"),
"@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"),
Expand Down