[compiler-rt] 959dbd1 - Revert "Revert "[cmake] [compiler-rt] Call llvm_setup_rpath() when adding shared libraries.""
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 22 16:13:44 PDT 2021
Author: Petr Hosek
Date: 2021-06-22T16:11:29-07:00
New Revision: 959dbd1761cddbe8c53509459dbc0463f86c1b50
URL: https://github.com/llvm/llvm-project/commit/959dbd1761cddbe8c53509459dbc0463f86c1b50
DIFF: https://github.com/llvm/llvm-project/commit/959dbd1761cddbe8c53509459dbc0463f86c1b50.diff
LOG: Revert "Revert "[cmake] [compiler-rt] Call llvm_setup_rpath() when adding shared libraries.""
This reverts commit 21c008d5a5b1e0c2ec3c1659cff961f4b0ccea2c since
it broke the build on macOS and Windows with the following error:
The install of the clang_rt.<na,e> target requires changing an
RPATH from the build tree, but this is not supported with the Ninja
generator unless on an ELF-based platform. The
CMAKE_BUILD_WITH_INSTALL_RPATH variable may be set to avoid this relinking
step.
Added:
Modified:
compiler-rt/cmake/Modules/AddCompilerRT.cmake
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index e72df6f8666da..1e9e7c58664b6 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -359,6 +359,9 @@ function(add_compiler_rt_runtime name type)
target_link_libraries(${libname} PRIVATE ${builtins_${libname}})
endif()
if(${type} STREQUAL "SHARED")
+ if(COMMAND llvm_setup_rpath)
+ llvm_setup_rpath(${libname})
+ endif()
if(WIN32 AND NOT CYGWIN AND NOT MINGW)
set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
More information about the llvm-commits
mailing list