summaryrefslogtreecommitdiff
path: root/compiler/GHC/Linker
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-02-05 15:27:20 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-06 13:01:28 -0400
commit410c76eea7370f2d1143cf79aa524fcdec184f89 (patch)
treec33e28b86e66b2d11717092be017baa536927f02 /compiler/GHC/Linker
parent5ece5c5a225d9919d87a6d760f4e583775793b8c (diff)
downloadhaskell-410c76eea7370f2d1143cf79aa524fcdec184f89.tar.gz
Use static archives as an alternative to object merging
Unfortunately, `lld`'s COFF backend does not currently support object merging. With ld.bfd having broken support for high image-load base addresses, it's necessary to find an alternative. Here I introduce support in the driver for generating static archives, which we use on Windows instead of object merging. Closes #21068.
Diffstat (limited to 'compiler/GHC/Linker')
-rw-r--r--compiler/GHC/Linker/Types.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/GHC/Linker/Types.hs b/compiler/GHC/Linker/Types.hs
index 040b7f8deb..ac01f35e33 100644
--- a/compiler/GHC/Linker/Types.hs
+++ b/compiler/GHC/Linker/Types.hs
@@ -14,6 +14,7 @@ module GHC.Linker.Types
, LinkableSet
, mkLinkableSet
, unionLinkableSet
+ , ObjFile
, Unlinked(..)
, SptEntry(..)
, isObjectLinkable
@@ -148,9 +149,11 @@ instance Outputable Linkable where
= (text "LinkableM" <+> parens (text (show when_made)) <+> ppr mod)
$$ nest 3 (ppr unlinkeds)
+type ObjFile = FilePath
+
-- | Objects which have yet to be linked by the compiler
data Unlinked
- = DotO FilePath -- ^ An object file (.o)
+ = DotO ObjFile -- ^ An object file (.o)
| DotA FilePath -- ^ Static archive file (.a)
| DotDLL FilePath -- ^ Dynamically linked library file (.so, .dll, .dylib)
| BCOs CompiledByteCode