Skip to content

Commit 80c01dd

Browse files
committed
[BOLT][runtime] Test for outline-atomics support
I'm using clang-10 to build bolt which doesn't have moutline-atomics option and though it doesn't do it. So test compiler for supporting it before appending to the list of cxxflags. Differential Revision: https://reviews.llvm.org/D159521
1 parent 6822708 commit 80c01dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bolt/runtime/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
cmake_minimum_required(VERSION 3.20.0)
2+
include(CheckCXXCompilerFlag)
23
include(CheckIncludeFiles)
34
include(GNUInstallDirs)
45

@@ -33,7 +34,10 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
3334
set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-sse")
3435
endif()
3536
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
36-
set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-outline-atomics")
37+
check_cxx_compiler_flag("-mno-outline-atomics" CXX_SUPPORTS_OUTLINE_ATOMICS)
38+
if (CXX_SUPPORTS_OUTLINE_ATOMICS)
39+
set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-outline-atomics")
40+
endif()
3741
endif()
3842

3943
# Don't let the compiler think it can create calls to standard libs

0 commit comments

Comments
 (0)