[Openmp-commits] [PATCH] D97413: [OpenMP] Fix clang-cl build error regarding TSX intrinsics

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 1 14:22:09 PST 2021


jlpeyton updated this revision to Diff 327291.
jlpeyton added a comment.

Ok, I see what you're saying. I've copied the exact idiom used in the LLVM CMake where `CMAKE_REQUIRED_FLAGS` is temporarily stored in `OLD_CMAKE_REQUIRED_FLAGS` and then restored after the check.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97413/new/

https://reviews.llvm.org/D97413

Files:
  openmp/runtime/cmake/config-ix.cmake


Index: openmp/runtime/cmake/config-ix.cmake
===================================================================
--- openmp/runtime/cmake/config-ix.cmake
+++ openmp/runtime/cmake/config-ix.cmake
@@ -175,6 +175,10 @@
       }
       int main() { int a = __kmp_umwait(0, 1000); return a; }")
   check_cxx_source_compiles("${source_code}" LIBOMP_HAVE_WAITPKG_INTRINSICS)
+  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+  if (LIBOMP_HAVE_MRTM_FLAG)
+    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mrtm")
+  endif()
   set(source_code "// check for attribute rtm and rtm intrinsics
       #ifdef IMMINTRIN_H
       #include <immintrin.h>
@@ -191,6 +195,7 @@
       int main() { int a = __kmp_xbegin(); return a; }")
   check_cxx_source_compiles("${source_code}" LIBOMP_HAVE_RTM_INTRINSICS)
   set(CMAKE_REQUIRED_DEFINITIONS)
+  set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
 endif()
 
 # Find perl executable


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97413.327291.patch
Type: text/x-patch
Size: 925 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210301/2f970f90/attachment.bin>


More information about the Openmp-commits mailing list