summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadrian/src/Settings/Builders/Ghc.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs
index 1a05681a35..0d4c273103 100644
--- a/hadrian/src/Settings/Builders/Ghc.hs
+++ b/hadrian/src/Settings/Builders/Ghc.hs
@@ -103,6 +103,7 @@ ghcLinkArgs = builder (Ghc LinkHs) ? do
buildPath <- getBuildPath
libffiName' <- libffiName
debugged <- ghcDebugged <$> expr flavour
+ needsLibffi <- expr useLibFFIForAdjustors
let
dynamic = Dynamic `wayUnit` way
@@ -124,8 +125,9 @@ ghcLinkArgs = builder (Ghc LinkHs) ? do
-- are not actually bundled with the rts. Perhaps ffi should be part of
-- rts's extra libraries instead of extra bundled libraries in that
-- case. Care should be take as to not break the make build.
- rtsFfiArg = package rts ? (not useSystemFfi && libffiName' `elem` libs) ? mconcat
+ rtsFfiArg = package rts ? (not useSystemFfi && needsLibffi) ? mconcat
[ arg ("-L" ++ buildPath)
+ , arg ("-l" ++ libffiName')
]
-- This is the -rpath argument that is required for the bindist scenario