summaryrefslogtreecommitdiff
path: root/hadrian/src/Settings.hs
diff options
context:
space:
mode:
authorDavid Eichmann <EichmannD@gmail.com>2019-01-15 12:34:06 -0700
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-22 23:35:18 -0500
commit806cc234426dca41e1c799e9e6212cf9e352d180 (patch)
tree76b5aec4aceea299fd14952e9d0ad8afedd1f56a /hadrian/src/Settings.hs
parent44ad7215a11cb49651233646c30ced9eb72eaad2 (diff)
downloadhaskell-806cc234426dca41e1c799e9e6212cf9e352d180.tar.gz
Build and copy libffi shared libraries correctly and enable dynamically linking ghc.
Test Plan: Ensure build environment does NOT have a system libffi installed (you may want to use a nix environment). Then `hadrian/build.sh -c --flavour=default` Reviewers: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15837
Diffstat (limited to 'hadrian/src/Settings.hs')
-rwxr-xr-xhadrian/src/Settings.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs
index fdbef1c359..bc0f8cecaa 100755
--- a/hadrian/src/Settings.hs
+++ b/hadrian/src/Settings.hs
@@ -50,12 +50,17 @@ flavour = do
getIntegerPackage :: Expr Package
getIntegerPackage = expr (integerLibrary =<< flavour)
+-- TODO: there is duplication and inconsistency between this and
+-- Rules.Program.getProgramContexts. There should only be one way to get a
+-- context / contexts for a given stage and package.
programContext :: Stage -> Package -> Action Context
programContext stage pkg = do
profiled <- ghcProfiled <$> flavour
- return $ if pkg == ghc && profiled && stage > Stage0
- then Context stage pkg profiling
- else vanillaContext stage pkg
+ dynGhcProgs <- dynamicGhcPrograms =<< flavour
+ return . Context stage pkg . wayFromUnits . concat $
+ [ [ Profiling | pkg == ghc && profiled && stage > Stage0 ]
+ , [ Dynamic | dynGhcProgs && stage > Stage0 ]
+ ]
-- TODO: switch to Set Package as the order of packages should not matter?
-- Otherwise we have to keep remembering to sort packages from time to time.