summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-05-06 15:13:35 +0100
committerBen Gamari <ben@smart-cactus.org>2022-05-18 11:16:59 -0400
commitefa1788a495f7944783e64006151fc5af172b8ac (patch)
treea33f29c21e7b3b438e18ae1a6b77bbaff48f7bea
parent03362f75e46cdb9a50758543448b0d54b5107fd5 (diff)
downloadhaskell-efa1788a495f7944783e64006151fc5af172b8ac.tar.gz
hadrian: Fix split-sections transformer
The splitSections transformer has been broken since -dynamic-too support was implemented in hadrian. This is because we actually build the dynamic way when building the dynamic way, so the predicate would always fail. The fix is to just always pass `split-sections` even if it doesn't do anything for a particular way. Fixes #21138 (cherry picked from commit 142a73d92ea1ef8054d3764b5897b83ad349fed5)
-rw-r--r--hadrian/src/Flavour.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index 41c86de5ff..f0ebacd7f2 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -30,6 +30,7 @@ import Text.Parsec.Combinator as P
import Text.Parsec.Char as P
import Control.Monad.Except
import UserSettings
+import Oracles.Setting
flavourTransformers :: Map String (Flavour -> Flavour)
@@ -131,13 +132,15 @@ enableTickyGhc =
-- select which package gets built with split sections
-- by passing a suitable predicate. If the predicate holds
-- for a given package, then @split-sections@ is used when
--- building it. If the given flavour doesn't build
--- anything in a @dyn@-enabled way, then 'splitSections' is a no-op.
+-- building it. Note that this transformer doesn't do anything
+-- on darwin because on darwin platforms we always enable subsections
+-- via symbols.
splitSectionsIf :: (Package -> Bool) -> Flavour -> Flavour
splitSectionsIf pkgPredicate = addArgs $ do
- way <- getWay
pkg <- getPackage
- (Dynamic `wayUnit` way) ? pkgPredicate pkg ?
+ osx <- expr isOsxTarget
+ not osx ? -- osx doesn't support split sections
+ pkgPredicate pkg ? -- Only apply to these packages
builder (Ghc CompileHs) ? arg "-split-sections"
-- | Like 'splitSectionsIf', but with a fixed predicate: use