summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-18 08:41:02 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-05-18 08:48:19 +0100
commitbb4fae32737585ce62a000acb6ca7a54639c424d (patch)
tree26466ebeffdcec0b4aee61de8d22bc9daf1737ca
parentfc9546caf3e16db070bfc7bb5523c38595233e26 (diff)
downloadhaskell-wip/t16022.tar.gz
hadrian: Correct "Don't always link against libffi"wip/t16022
I made a mistake in patch 18893bfe81bc91c2a24815d7320b5e2ec4fee3b0 by assuming that the rts `ffi` flag was True whenever we needed libffi but actual it's only set if we are using the system libffi rather than the one that is built in-tree. Fixes #16022
-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