Commit 98430836 authored by ian@well-typed.com's avatar ian@well-typed.com
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 ...@@ -186,7 +186,7 @@ else
ifneq "$$(UseSystemLibFFI)" "YES" ifneq "$$(UseSystemLibFFI)" "YES"
LIBFFI_LIBS = -Lrts/dist/build -lffi LIBFFI_LIBS = -Lrts/dist/build -lffi
ifeq "$$(TargetElf)" "YES" 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
endif endif
else else
......
...@@ -128,7 +128,7 @@ ifneq "$4" "0" ...@@ -128,7 +128,7 @@ ifneq "$4" "0"
ifeq "$$(TargetOS_CPP)" "linux" ifeq "$$(TargetOS_CPP)" "linux"
$1_$2_$3_GHC_LD_OPTS += \ $1_$2_$3_GHC_LD_OPTS += \
-fno-use-rpaths \ -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" else ifeq "$$(TargetOS_CPP)" "darwin"
$1_$2_$3_GHC_LD_OPTS += -optl-Wl,-headerpad_max_install_names $1_$2_$3_GHC_LD_OPTS += -optl-Wl,-headerpad_max_install_names
endif endif
......
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