Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
147 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- llvm-10.0.0.src/include/llvm/ADT/Triple.h.orig 2020-05-15 15:49:40.073000000 +0200 | ||
+++ llvm-10.0.0.src/include/llvm/ADT/Triple.h 2020-05-15 20:51:29.844520400 +0200 | ||
@@ -748,7 +748,7 @@ | ||
|
||
/// Tests whether the target uses emulated TLS as default. | ||
bool hasDefaultEmulatedTLS() const { | ||
- return isAndroid() || isOSOpenBSD() || isWindowsCygwinEnvironment(); | ||
+ return isAndroid() || isOSOpenBSD() || isOSCygMing(); | ||
} | ||
|
||
/// @} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
From 534c1b47a25f89957d18599a82a9dd5108bdceda Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= <mati865@gmail.com> | ||
Date: Mon, 25 May 2020 15:12:52 +0200 | ||
Subject: [PATCH] Fix implib for MinGW | ||
|
||
--- | ||
runtime/cmake/LibompExports.cmake | 11 +++++++- | ||
runtime/cmake/LibompMicroTests.cmake | 6 ++++- | ||
runtime/src/CMakeLists.txt | 38 ++++++++++++++++------------ | ||
3 files changed, 37 insertions(+), 18 deletions(-) | ||
|
||
diff --git a/runtime/cmake/LibompExports.cmake b/runtime/cmake/LibompExports.cmake | ||
index f98de26..e0b20cf 100644 | ||
--- a/runtime/cmake/LibompExports.cmake | ||
+++ b/runtime/cmake/LibompExports.cmake | ||
@@ -82,7 +82,7 @@ add_custom_command(TARGET omp POST_BUILD | ||
) | ||
|
||
# Copy Windows import library into exports/ directory post build | ||
-if(WIN32) | ||
+if(MSVC) | ||
get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY ompimp ARCHIVE_OUTPUT_DIRECTORY) | ||
if(NOT LIBOMPIMP_OUTPUT_DIRECTORY) | ||
set(LIBOMPIMP_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) | ||
@@ -91,4 +91,13 @@ if(WIN32) | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBOMP_EXPORTS_LIB_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMPIMP_OUTPUT_DIRECTORY}/${LIBOMP_IMP_LIB_FILE} ${LIBOMP_EXPORTS_LIB_DIR} | ||
) | ||
+elseif(WIN32) | ||
+ get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY omp ARCHIVE_OUTPUT_DIRECTORY) | ||
+ if(NOT LIBOMPIMP_OUTPUT_DIRECTORY) | ||
+ set(LIBOMPIMP_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) | ||
+ endif() | ||
+ add_custom_command(TARGET omp POST_BUILD | ||
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBOMP_EXPORTS_LIB_DIR} | ||
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMPIMP_OUTPUT_DIRECTORY}/${LIBOMP_IMP_LIB_FILE} ${LIBOMP_EXPORTS_LIB_DIR} | ||
+ ) | ||
endif() | ||
diff --git a/runtime/cmake/LibompMicroTests.cmake b/runtime/cmake/LibompMicroTests.cmake | ||
index d6e4db2..9eaee06 100644 | ||
--- a/runtime/cmake/LibompMicroTests.cmake | ||
+++ b/runtime/cmake/LibompMicroTests.cmake | ||
@@ -40,7 +40,11 @@ | ||
# get library location | ||
if(WIN32) | ||
get_target_property(LIBOMP_OUTPUT_DIRECTORY omp RUNTIME_OUTPUT_DIRECTORY) | ||
- get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY ompimp ARCHIVE_OUTPUT_DIRECTORY) | ||
+ if(MSVC) | ||
+ get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY ompimp ARCHIVE_OUTPUT_DIRECTORY) | ||
+ else() | ||
+ get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY omp ARCHIVE_OUTPUT_DIRECTORY) | ||
+ endif() | ||
if(NOT LIBOMPIMP_OUTPUT_DIRECTORY) | ||
set(LIBOMPIMP_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) | ||
endif() | ||
diff --git a/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt | ||
index 9f46b4b..e62bd0a 100644 | ||
--- a/runtime/src/CMakeLists.txt | ||
+++ b/runtime/src/CMakeLists.txt | ||
@@ -195,28 +195,30 @@ if(WIN32) | ||
# the import library is "re-linked" to include kmp_import.cpp which prevents | ||
# linking of both Visual Studio OpenMP and newly built OpenMP | ||
set_source_files_properties(kmp_import.cpp PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_CXXFLAGS}") | ||
- set(LIBOMP_IMP_LIB_FILE ${LIBOMP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
+ set(LIBOMP_IMP_LIB_FILE ${LIBOMP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}) | ||
set(LIBOMP_GENERATED_IMP_LIB_FILENAME ${LIBOMP_LIB_FILE}${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
set_target_properties(omp PROPERTIES | ||
VERSION ${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR} # uses /version flag | ||
IMPORT_PREFIX "" IMPORT_SUFFIX "" # control generated import library name when building omp | ||
ARCHIVE_OUTPUT_NAME ${LIBOMP_GENERATED_IMP_LIB_FILENAME} | ||
) | ||
- # Get generated import library from creating omp | ||
- get_target_property(LIBOMP_IMPORT_LIB_DIRECTORY omp ARCHIVE_OUTPUT_DIRECTORY) | ||
- if(LIBOMP_IMPORT_LIB_DIRECTORY) | ||
- set(LIBOMP_GENERATED_IMP_LIB ${LIBOMP_IMPORT_LIB_DIRECTORY}/${LIBOMP_GENERATED_IMP_LIB_FILENAME}) | ||
- else() | ||
- set(LIBOMP_GENERATED_IMP_LIB ${CMAKE_CURRENT_BINARY_DIR}/${LIBOMP_GENERATED_IMP_LIB_FILENAME}) | ||
+ if(MSVC) | ||
+ # Get generated import library from creating omp | ||
+ get_target_property(LIBOMP_IMPORT_LIB_DIRECTORY omp ARCHIVE_OUTPUT_DIRECTORY) | ||
+ if(LIBOMP_IMPORT_LIB_DIRECTORY) | ||
+ set(LIBOMP_GENERATED_IMP_LIB ${LIBOMP_IMPORT_LIB_DIRECTORY}/${LIBOMP_GENERATED_IMP_LIB_FILENAME}) | ||
+ else() | ||
+ set(LIBOMP_GENERATED_IMP_LIB ${CMAKE_CURRENT_BINARY_DIR}/${LIBOMP_GENERATED_IMP_LIB_FILENAME}) | ||
+ endif() | ||
+ set_source_files_properties(${LIBOMP_GENERATED_IMP_LIB} PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE) | ||
+ # Create new import library that is just the previously created one + kmp_import.cpp | ||
+ add_library(ompimp STATIC ${LIBOMP_GENERATED_IMP_LIB} kmp_import.cpp) | ||
+ set_target_properties(ompimp PROPERTIES | ||
+ PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}" | ||
+ LINKER_LANGUAGE C | ||
+ ) | ||
+ add_dependencies(ompimp omp) # ensure generated import library is created first | ||
endif() | ||
- set_source_files_properties(${LIBOMP_GENERATED_IMP_LIB} PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE) | ||
- # Create new import library that is just the previously created one + kmp_import.cpp | ||
- add_library(ompimp STATIC ${LIBOMP_GENERATED_IMP_LIB} kmp_import.cpp) | ||
- set_target_properties(ompimp PROPERTIES | ||
- PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}" | ||
- LINKER_LANGUAGE C | ||
- ) | ||
- add_dependencies(ompimp omp) # ensure generated import library is created first | ||
|
||
# Create def file to designate exported functions | ||
libomp_get_gdflags(LIBOMP_GDFLAGS) # generate-def.pl flags (Windows only) | ||
@@ -290,7 +292,11 @@ else() | ||
endif() | ||
if(WIN32) | ||
install(TARGETS omp RUNTIME DESTINATION bin) | ||
- install(TARGETS ompimp ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}") | ||
+ if(MSVC) | ||
+ install(TARGETS ompimp ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}") | ||
+ else() | ||
+ install(TARGETS omp ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}") | ||
+ endif() | ||
# Create aliases (regular copies) of the library for backwards compatibility | ||
set(LIBOMP_ALIASES "libiomp5md") | ||
foreach(alias IN LISTS LIBOMP_ALIASES) | ||
-- | ||
2.26.2.windows.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters