diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel index 72558360228a..76fe5e5d939e 100644 --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -16,6 +16,29 @@ package( exports_files(["LICENSE.TXT"]) +config_setting( + name = "macos_arm64", + values = { + "apple_platform_type": "macos", + "cpu": "darwin_arm64", + }, +) + +config_setting( + name = "linux_aarch64", + values = {"cpu": "aarch64"}, +) + +config_setting( + name = "linux_ppc64le", + values = {"cpu": "ppc"}, +) + +config_setting( + name = "linux_s390x", + values = {"cpu": "s390x"}, +) + # It may be tempting to add compiler flags here, but that should be avoided. # The necessary warnings and other compile flags should be provided by the # toolchain or the `.bazelrc` file. This is just a workaround until we have a diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl index 5beb3cc7c410..698476e74e00 100644 --- a/utils/bazel/llvm-project-overlay/llvm/config.bzl +++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl @@ -82,11 +82,11 @@ os_defines = select({ # TODO: We should split out host vs. target here. llvm_config_defines = os_defines + 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"), - "@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"), - "@bazel_tools//src/conditions:linux_ppc64le": native_arch_defines("PowerPC", "powerpc64le-unknown-linux-gnu"), - "@bazel_tools//src/conditions:linux_s390x": native_arch_defines("SystemZ", "systemz-unknown-linux_gnu"), + "//llvm:macos_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"), + "@bazel_tools//src/conditions:darwin": native_arch_defines("X86", "x86_64-unknown-darwin"), + "//llvm:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"), + "//llvm:linux_ppc64le": native_arch_defines("PowerPC", "powerpc64le-unknown-linux-gnu"), + "//llvm:linux_s390x": native_arch_defines("SystemZ", "systemz-unknown-linux_gnu"), "//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"), }) + [ # These shouldn't be needed by the C++11 standard, but are for some