[PATCH] D43751: [cmake] Append -Wl, -rpath-link conditionally to GNULD
Michał Górny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 26 00:15:13 PST 2018
mgorny created this revision.
mgorny added reviewers: beanz, emaste.
Herald added subscribers: kristof.beyls, krytarowski.
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.
Repository:
rL LLVM
https://reviews.llvm.org/D43751
Files:
cmake/modules/AddLLVM.cmake
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1589,7 +1589,8 @@
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} ")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43751.135854.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180226/d12fb101/attachment.bin>
More information about the llvm-commits
mailing list