Skip to content
Snippets Groups Projects
Commit 6d7d4393 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

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.
parent 3c3060e4
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment