summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-12-12 19:19:24 -0500
committerBen Gamari <ben@smart-cactus.org>2022-12-21 16:47:28 -0500
commit896eddd21bcc72f0733b2b1a3d4fa59d4b486233 (patch)
treed40cb1188b7eab865f78945273cc4050eb6b1dd8
parentc30accc2f8a0585c76cb534beda04fba624bce1c (diff)
downloadhaskell-wip/T22527.tar.gz
hadrian: Ensure that linker scripts are used when merging objectswip/T22527
In #22527 @rui314 inadvertantly pointed out a glaring bug in Hadrian's implementation of the object merging rules: unlike the old `make` build system we utterly failed to pass the needed linker scripts. Fix this.
-rw-r--r--hadrian/src/Flavour.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index 58baa7c3a9..fc820bdf87 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -193,8 +193,12 @@ splitSectionsIf pkgPredicate = addArgs $ do
pkg <- getPackage
osx <- expr isOsxTarget
not osx ? -- osx doesn't support split sections
- pkgPredicate pkg ? -- Only apply to these packages
- builder (Ghc CompileHs) ? arg "-split-sections"
+ pkgPredicate pkg ? mconcat -- Only apply to these packages
+ [ builder (Ghc CompileHs) ? arg "-split-sections"
+ , builder MergeObjects ? ifM (expr isWinTarget)
+ (pure ["-t", "driver/utils/merge_sections_pe.ld"])
+ (pure ["-t", "driver/utils/merge_sections.ld"])
+ ]
-- | Like 'splitSectionsIf', but with a fixed predicate: use
-- split sections for all packages but the GHC library.