[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
This commit is contained in:
Vladislav Khmelevsky 2023-09-15 14:52:20 +04:00
parent 682270877d
commit 80c01dd626

View File

@ -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