Skip to content

Commit f3a8a7b

Browse files
committed
[Bazel] Unconditionally define STDC LIMIT/CONSTANT/FORMAT
These are unconditionally included in the CMake build as well and necessary for some odd platforms (even though the C++11 standard says they shouldn't be). Reviewed By: chandlerc Differential Revision: https://reviews.llvm.org/D107123
1 parent 6fa2d0f commit f3a8a7b

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
@@ -75,4 +75,13 @@ llvm_config_defines = os_defines + select({
7575
"@bazel_tools//src/conditions:darwin": native_arch_defines("X86", "x86_64-unknown-darwin"),
7676
"@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"),
7777
"//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"),
78-
})
78+
}) + [
79+
# These shouldn't be needed by the C++11 standard, but are for some
80+
# platforms (e.g. glibc < 2.18. See
81+
# https://sourceware.org/bugzilla/show_bug.cgi?id=15366). These are also
82+
# included unconditionally in the CMake build:
83+
# https://github.com/llvm/llvm-project/blob/cd0dd8ece8e/llvm/cmake/modules/HandleLLVMOptions.cmake#L907-L909
84+
"__STDC_LIMIT_MACROS",
85+
"__STDC_CONSTANT_MACROS",
86+
"__STDC_FORMAT_MACROS",
87+
]

0 commit comments

Comments
 (0)