summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-12-12 19:19:24 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-24 21:09:56 -0500
commit6d7d4393e15a6d0a2b42ec986ec6bd3df27baaa7 (patch)
tree386e6e89866d00713d9d36fe5474974f14db1af6
parent3c3060e4645b12595b187e7dbaa758e8adda15e0 (diff)
downloadhaskell-6d7d4393e15a6d0a2b42ec986ec6bd3df27baaa7.tar.gz
hadrian: Ensure that linker scripts are used when merging objects
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 9c28397b31..f1e4aba881 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.