aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Khmelevsky <och95@yandex.ru>2023-09-15 14:52:20 +0400
committerVladislav Khmelevsky <och95@yandex.ru>2023-09-19 23:29:05 +0400
commit80c01dd626e05369aa438ca3800bbd5874cfc8e4 (patch)
treef4b9fc539db5e600df279d3e6a69361ca99c69b3
parent682270877d43c26d2ab3eed8c7f88bff12e9f19d (diff)
downloadllvm-80c01dd626e05369aa438ca3800bbd5874cfc8e4.zip
llvm-80c01dd626e05369aa438ca3800bbd5874cfc8e4.tar.gz
llvm-80c01dd626e05369aa438ca3800bbd5874cfc8e4.tar.bz2
[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
-rw-r--r--bolt/runtime/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/bolt/runtime/CMakeLists.txt b/bolt/runtime/CMakeLists.txt
index 838c8cb..6a65f80 100644
--- a/bolt/runtime/CMakeLists.txt
+++ b/bolt/runtime/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.20.0)
+include(CheckCXXCompilerFlag)
include(CheckIncludeFiles)
include(GNUInstallDirs)
@@ -33,7 +34,10 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-sse")
endif()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
- set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-outline-atomics")
+ check_cxx_compiler_flag("-mno-outline-atomics" CXX_SUPPORTS_OUTLINE_ATOMICS)
+ if (CXX_SUPPORTS_OUTLINE_ATOMICS)
+ set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-outline-atomics")
+ endif()
endif()
# Don't let the compiler think it can create calls to standard libs