summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2019-03-10 17:37:48 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-03-12 09:04:52 -0400
commit4cf2160afe0e08fe29576895a1eced863d3a521d (patch)
tree6fc57d65930c12a4261cbdb8ed93c9823d462950
parent705fa21d674a5a799712346e01033db98b16e71d (diff)
downloadhaskell-4cf2160afe0e08fe29576895a1eced863d3a521d.tar.gz
Hadrian: Fix rpath so shared objects work after being copied
After being copied all the shared objects end up in the same directory. Therefore the correct rpath is `$ORIGIN` rather than the computed path which is relative to the directory where it is built.
-rw-r--r--hadrian/src/Settings/Builders/Ghc.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs
index 7fb3082a51..0d0d58a09f 100644
--- a/hadrian/src/Settings/Builders/Ghc.hs
+++ b/hadrian/src/Settings/Builders/Ghc.hs
@@ -82,8 +82,8 @@ ghcLinkArgs = builder (Ghc LinkHs) ? do
[ arg "-dynamic"
-- TODO what about windows?
, isLibrary pkg ? pure [ "-shared", "-dynload", "deploy" ]
- , notStage0 ?
- hostSupportsRPaths ? arg ("-optl-Wl,-rpath," ++ rpath)
+ , hostSupportsRPaths ? arg ("-optl-Wl,-rpath," ++ rpath)
+ , hostSupportsRPaths ? arg ("-optl-Wl,-rpath,$ORIGIN")
]
, arg "-no-auto-link-packages"
, nonHsMainPackage pkg ? arg "-no-hs-main"