[Git][ghc/ghc][master] Detect the `mold` linker

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Feb 10 11:52:31 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
11e0cacb by Rebecca Turner at 2023-02-10T06:52:09-05:00
Detect the `mold` linker

Enables support for the `mold` linker by rui314.

- - - - -


2 changed files:

- compiler/GHC/Driver/Session.hs
- compiler/GHC/SysTools/Info.hs


Changes:

=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -4939,6 +4939,7 @@ needSourceNotes dflags = debugLevel dflags > 0
 -- LinkerInfo contains any extra options needed by the system linker.
 data LinkerInfo
   = GnuLD    [Option]
+  | Mold     [Option]
   | GnuGold  [Option]
   | LlvmLLD  [Option]
   | DarwinLD [Option]


=====================================
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]



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/11e0cacb039cee4198cd6043ab0d9e08332d4d8a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/11e0cacb039cee4198cd6043ab0d9e08332d4d8a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230210/3a94865a/attachment-0001.html>


More information about the ghc-commits mailing list