[cmake] Append -Wl,-rpath-link conditionally to GNULD
authorMichal Gorny <mgorny@gentoo.org>
Thu, 8 Mar 2018 15:09:38 +0000 (15:09 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Thu, 8 Mar 2018 15:09:38 +0000 (15:09 +0000)
commit93176a813a92542586356092a7a44e60196a390b
tree6f8b4ce5368e588fe334aec03edf857ff3912d5b
parent1136ec64e86973dc9f3b0da528d752029dc33731
[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

llvm-svn: 327007
llvm/cmake/modules/AddLLVM.cmake