[PATCH] D159521: [BOLT][runtime] Test for outline-atomics support

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 03:54:44 PDT 2023


yota9 created this revision.
yota9 added reviewers: maksfb, rafauler, Amir.
Herald added subscribers: treapster, ayermolo.
Herald added a project: All.
yota9 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159521

Files:
  bolt/runtime/CMakeLists.txt


Index: bolt/runtime/CMakeLists.txt
===================================================================
--- bolt/runtime/CMakeLists.txt
+++ 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 @@
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159521.556841.patch
Type: text/x-patch
Size: 768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230915/94551319/attachment.bin>


More information about the llvm-commits mailing list