summaryrefslogtreecommitdiff
path: root/compiler/GHC/Linker/Static.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-06-17 16:52:58 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-20 07:13:41 -0400
commit6281a333303a4dbe75a97a87c17c0fbace5268f5 (patch)
tree72f0fc5405fe5bfefdc5cd8183d10389f5b53079 /compiler/GHC/Linker/Static.hs
parent6c783817ef089e85642c3383937117cff9d15f67 (diff)
downloadhaskell-6281a333303a4dbe75a97a87c17c0fbace5268f5.tar.gz
Linker/darwin: Properly honour -fno-use-rpaths
The specification is now simple * On linux, use `-Xlinker -rpath -Xlinker` to set the rpath of the executable * On darwin, never use `-Xlinker -rpath -Xlinker`, always inject the rpath afterwards, see `runInjectRPaths`. * If `-fno-use-rpaths` is passed then *never* inject anything into the rpath. Fixes #20004
Diffstat (limited to 'compiler/GHC/Linker/Static.hs')
-rw-r--r--compiler/GHC/Linker/Static.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Linker/Static.hs b/compiler/GHC/Linker/Static.hs
index b0b8f1c541..a94fa153f6 100644
--- a/compiler/GHC/Linker/Static.hs
+++ b/compiler/GHC/Linker/Static.hs
@@ -95,7 +95,7 @@ linkBinary' staticLink logger tmpfs dflags unit_env o_files dep_units = do
(l `makeRelativeTo` full_output_fn)
else l
-- See Note [-Xlinker -rpath vs -Wl,-rpath]
- rpath = if gopt Opt_RPath dflags
+ rpath = if useXLinkerRPath dflags (platformOS platform)
then ["-Xlinker", "-rpath", "-Xlinker", libpath]
else []
-- Solaris 11's linker does not support -rpath-link option. It silently