summaryrefslogtreecommitdiff
path: root/compiler/GHC/SysTools
diff options
context:
space:
mode:
authorRebecca Turner <rbt@sent.as>2023-02-03 12:57:00 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-02-10 06:52:09 -0500
commit11e0cacb039cee4198cd6043ab0d9e08332d4d8a (patch)
treeae8cc89b1bb40b6de9cbc1c0cca9e3306f1b1bd1 /compiler/GHC/SysTools
parente45eb82830d6de4d09abb548e190be980dd001b4 (diff)
downloadhaskell-11e0cacb039cee4198cd6043ab0d9e08332d4d8a.tar.gz
Detect the `mold` linker
Enables support for the `mold` linker by rui314.
Diffstat (limited to 'compiler/GHC/SysTools')
-rw-r--r--compiler/GHC/SysTools/Info.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/GHC/SysTools/Info.hs b/compiler/GHC/SysTools/Info.hs
index ca16146771..d9ebe58cae 100644
--- a/compiler/GHC/SysTools/Info.hs
+++ b/compiler/GHC/SysTools/Info.hs
@@ -70,6 +70,7 @@ The flag is only needed on ELF systems. On Windows (PE) and Mac OS X
neededLinkArgs :: LinkerInfo -> [Option]
neededLinkArgs (GnuLD o) = o
+neededLinkArgs (Mold o) = o
neededLinkArgs (GnuGold o) = o
neededLinkArgs (LlvmLLD o) = o
neededLinkArgs (DarwinLD o) = o
@@ -106,6 +107,10 @@ getLinkerInfo' logger dflags = do
-- see Note [ELF needed shared libs]
"-Wl,--no-as-needed"])
+ | any ("mold" `isPrefixOf`) stdo =
+ return (Mold $ map Option [ --see Note [ELF needed shared libs]
+ "-Wl,--no-as-needed"])
+
| any ("GNU gold" `isPrefixOf`) stdo =
-- GNU gold only needs --no-as-needed. #10110.
-- ELF specific flag, see Note [ELF needed shared libs]