summaryrefslogtreecommitdiff
path: root/cmake/modules
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2018-03-08 15:09:38 +0000
committerMichal Gorny <mgorny@gentoo.org>2018-03-08 15:09:38 +0000
commita7c94b20187a60cf1508ce882ee37b3a056eb0bd (patch)
tree3cb2e0de5be9bd9ba8623be7b062fb061d8eed4d /cmake/modules
parenta3b56b24e78f245b007c64fdab011bd54e88f8ff (diff)
[cmake] Append -Wl,-rpath-link conditionally to GNULD
Append -Wl,-rpath-link conditionally to whether GNU ld.bfd is used rather than the Linux+!gold conditionals. Also move it out of 'else' branch of *BSD handling. This fixes build failures with ld.bfd on Gentoo/FreeBSD, and should cause no harm on other systems using ld.bfd. This patch improves the original logic by reusing results of linker detection introduced in r307852. Differential Revision: https://reviews.llvm.org/D43751 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/AddLLVM.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 20166d2cd30..95d47d00e51 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -1589,7 +1589,8 @@ function(llvm_setup_rpath name)
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
set_property(TARGET ${name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-z,origin ")
- elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT LLVM_LINKER_IS_GOLD)
+ endif()
+ if(LLVM_LINKER_IS_GNULD)
# $ORIGIN is not interpreted at link time by ld.bfd
set_property(TARGET ${name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-rpath-link,${LLVM_LIBRARY_OUTPUT_INTDIR} ")