summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-11 11:40:17 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-05-11 11:42:39 +0100
commit18893bfe81bc91c2a24815d7320b5e2ec4fee3b0 (patch)
tree6218de61da3c8cb289c78bd5f55cfb3ad618c7dc
parent736d47ffb7370ba4348b142c913b88e4c82347d0 (diff)
downloadhaskell-wip/not-always-ffi.tar.gz
hadrian: Don't always links against libffiwip/not-always-ffi
The RTS flag `ffi` is set to either True or False depending on whether we want to link against `libffi`, therefore in order to work out whether to add the build tree to the arguments we check whether `ffi` is in the extraLibs or not before adding the argument. Fixes #16022
-rw-r--r--hadrian/src/Settings/Builders/Ghc.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs
index c3dad6d4d7..1a05681a35 100644
--- a/hadrian/src/Settings/Builders/Ghc.hs
+++ b/hadrian/src/Settings/Builders/Ghc.hs
@@ -124,9 +124,8 @@ 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 ? mconcat
+ rtsFfiArg = package rts ? (not useSystemFfi && libffiName' `elem` libs) ? mconcat
[ arg ("-L" ++ buildPath)
- , arg ("-l" ++ libffiName')
]
-- This is the -rpath argument that is required for the bindist scenario