Skip to content

Commit

Permalink
[BOLT][runtime] Test for outline-atomics support
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yota9 committed Sep 19, 2023
1 parent 6822708 commit 80c01dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bolt/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.20.0)
include(CheckCXXCompilerFlag)
include(CheckIncludeFiles)
include(GNUInstallDirs)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 80c01dd

Please sign in to comment.