diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-03-24 21:00:44 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-06 13:01:28 -0400 |
commit | 3ac80a8609418f9f1e9aa025b182fb3445f14428 (patch) | |
tree | 207223dc28b689120628585b3fa0fd3554d1ae5c /hadrian/src/Settings | |
parent | 41fcb5cd756f52cd313d90a73f556fa5f3890818 (diff) | |
download | haskell-3ac80a8609418f9f1e9aa025b182fb3445f14428.tar.gz |
hadrian: Produce ar archives with L modifier on Windows
Since object files may in fact be archive files, we must ensure that
their contents are merged rather than constructing an
archive-of-an-archive.
See #21068.
Diffstat (limited to 'hadrian/src/Settings')
-rw-r--r-- | hadrian/src/Settings/Builders/Ar.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hadrian/src/Settings/Builders/Ar.hs b/hadrian/src/Settings/Builders/Ar.hs index a4b08d6358..08379f07f8 100644 --- a/hadrian/src/Settings/Builders/Ar.hs +++ b/hadrian/src/Settings/Builders/Ar.hs @@ -8,7 +8,13 @@ import Settings.Builders.Common arBuilderArgs :: Args arBuilderArgs = mconcat [ builder (Ar Pack) ? mconcat - [ arg "q" + [ -- When building on platforms which don't support object merging + -- we must use the -L flag supported by llvm-ar, which ensures that + -- .a files added to the archive are merged into the resulting archive, + -- not added as a single file. This requires that we are using llvm-ar + -- + -- See Note [Object merging] in GHC.Driver.Pipeline.Execute for details. + ifM ((&&) <$> notStage0 <*> expr (flag ArSupportsDashL)) (arg "qL") (arg "q") , arg =<< getOutput ] , builder (Ar Unpack) ? mconcat |