Commit 98430836 authored by's avatar
Browse files

When linking with $ORIGIN rpaths, use the "-z origin" linker flag too

On FreeBSD, one needs use "-z origin" in order to enable resolution
of $ORIGIN in RPATH. Part of #7819.
parent ebc4305e
......@@ -186,7 +186,7 @@ else
ifneq "$$(UseSystemLibFFI)" "YES"
LIBFFI_LIBS = -Lrts/dist/build -lffi
ifeq "$$(TargetElf)" "YES"
LIBFFI_LIBS += -optl-Wl,-rpath -optl-Wl,'$$$$ORIGIN'
LIBFFI_LIBS += -optl-Wl,-rpath -optl-Wl,'$$$$ORIGIN' -optl-Wl,-z -optl-Wl,origin
......@@ -128,7 +128,7 @@ ifneq "$4" "0"
ifeq "$$(TargetOS_CPP)" "linux"
$1_$2_$3_GHC_LD_OPTS += \
-fno-use-rpaths \
$$(foreach d,$$($1_$2_TRANSITIVE_DEPS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d')
$$(foreach d,$$($1_$2_TRANSITIVE_DEPS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-z -optl-Wl,origin
else ifeq "$$(TargetOS_CPP)" "darwin"
$1_$2_$3_GHC_LD_OPTS += -optl-Wl,-headerpad_max_install_names
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment