Commit 4cf2160a authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot

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.
parent 705fa21d
......@@ -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"
......
Markdown is supported
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