summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-05-06 15:13:35 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-10 20:48:04 -0400
commit142a73d92ea1ef8054d3764b5897b83ad349fed5 (patch)
treeed347d098e124830e0dd5eeb6528fac5af5525ec /hadrian
parentbdc99cc22c903d15eb7f4cd8da4b37d307179808 (diff)
downloadhaskell-142a73d92ea1ef8054d3764b5897b83ad349fed5.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
Diffstat (limited to 'hadrian')
-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 02d94448f6..41d2f66f19 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -31,6 +31,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)
@@ -134,13 +135,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