summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-03-03 11:30:24 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-06 02:34:08 -0500
commit9e0c0c3a7b6cad8c08e5de7e2a27cf2cb2d2368f (patch)
tree665c0869e1b6bd2f5329372dfdb92507e8c870bb
parentdd23bd740f7fc64475e026fbbabec8674401a8b6 (diff)
downloadhaskell-9e0c0c3a7b6cad8c08e5de7e2a27cf2cb2d2368f.tar.gz
hadrian: Pass -fno-use-rpaths to GHC while linking
This mirrors the make build system and ensures that we don't end up with references to the build directory in the final executable. Fixes #19485.
-rw-r--r--hadrian/src/Settings/Builders/Ghc.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs
index 3880a99562..29ca57a4f2 100644
--- a/hadrian/src/Settings/Builders/Ghc.hs
+++ b/hadrian/src/Settings/Builders/Ghc.hs
@@ -145,6 +145,10 @@ ghcLinkArgs = builder (Ghc LinkHs) ? do
, isProgram pkg ? arg ("-optl-Wl,-rpath," ++ bindistRpath)
-- The darwin linker doesn't support/require the -zorigin option
, not osxHost ? arg "-optl-Wl,-zorigin"
+ -- We set RPATH directly (relative to $ORIGIN). There's
+ -- no reason for GHC to inject further RPATH entries.
+ -- See #19485.
+ , arg "-fno-use-rpaths"
]
]
, arg "-no-auto-link-packages"