[Openmp-commits] [PATCH] D102425: [OpenMP] Use more compatible flags format

Mateusz MikuĊ‚a via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu May 13 10:52:33 PDT 2021


mati865 created this revision.
mati865 added a reviewer: OpenMP.
mati865 added a project: OpenMP.
Herald added subscribers: guansong, yaxunl, mgorny.
mati865 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

MSYS2 threats strings starting with forward slashes as paths (similarly to UNIX). We have been replacing them with `-` using `sed` but I think it'd be beneficial to solve it upstream.
I cannot test MSVC but AFAIK it accepts both formats.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102425

Files:
  openmp/runtime/cmake/LibompHandleFlags.cmake
  openmp/runtime/cmake/LibompMicroTests.cmake
  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
@@ -111,7 +111,7 @@
 
 # Check linker flags
 if(WIN32)
-  libomp_check_linker_flag(/SAFESEH LIBOMP_HAVE_SAFESEH_FLAG)
+  libomp_check_linker_flag(-SAFESEH LIBOMP_HAVE_SAFESEH_FLAG)
 elseif(NOT APPLE)
   libomp_check_linker_flag(-Wl,-x LIBOMP_HAVE_X_FLAG)
   libomp_check_linker_flag(-Wl,--warn-shared-textrel LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG)
Index: openmp/runtime/cmake/LibompMicroTests.cmake
===================================================================
--- openmp/runtime/cmake/LibompMicroTests.cmake
+++ openmp/runtime/cmake/LibompMicroTests.cmake
@@ -63,7 +63,7 @@
   libomp_append(libomp_test_touch_cflags /nologo)
   libomp_append(libomp_test_touch_libs ${LIBOMPIMP_OUTPUT_DIRECTORY}/${LIBOMP_IMP_LIB_FILE})
   if(${IA32})
-    libomp_append(libomp_test_touch_ldflags /safeseh)
+    libomp_append(libomp_test_touch_ldflags -safeseh)
   endif()
 else() # (Unix based systems, Intel(R) MIC Architecture, and Mac)
   if(LIBOMP_SHELL)
Index: openmp/runtime/cmake/LibompHandleFlags.cmake
===================================================================
--- openmp/runtime/cmake/LibompHandleFlags.cmake
+++ openmp/runtime/cmake/LibompHandleFlags.cmake
@@ -79,8 +79,8 @@
     if(CMAKE_SIZEOF_VOID_P EQUAL 8)
       libomp_append(asmflags_local -m32 LIBOMP_HAVE_M32_FLAG)
     endif()
-    libomp_append(asmflags_local /safeseh LIBOMP_HAVE_SAFESEH_MASM_FLAG)
-    libomp_append(asmflags_local /coff LIBOMP_HAVE_COFF_MASM_FLAG)
+    libomp_append(asmflags_local -safeseh LIBOMP_HAVE_SAFESEH_MASM_FLAG)
+    libomp_append(asmflags_local -coff LIBOMP_HAVE_COFF_MASM_FLAG)
   elseif(${MIC})
     libomp_append(asmflags_local -mmic LIBOMP_HAVE_MMIC_FLAG)
   endif()
@@ -105,7 +105,7 @@
   libomp_append(ldflags_local -Wl,-z,noexecstack LIBOMP_HAVE_Z_NOEXECSTACK_FLAG)
   libomp_append(ldflags_local -no-intel-extensions LIBOMP_HAVE_NO_INTEL_EXTENSIONS_FLAG)
   libomp_append(ldflags_local -static-intel LIBOMP_HAVE_STATIC_INTEL_FLAG)
-  libomp_append(ldflags_local /SAFESEH LIBOMP_HAVE_SAFESEH_FLAG)
+  libomp_append(ldflags_local -SAFESEH LIBOMP_HAVE_SAFESEH_FLAG)
   # Architectural linker flags
   if(${IA32})
     if(CMAKE_SIZEOF_VOID_P EQUAL 8)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102425.345199.patch
Type: text/x-patch
Size: 2351 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210513/2641123b/attachment-0001.bin>


More information about the Openmp-commits mailing list