Commit 2d1f6af4 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

SysTools: Add detection support for LLD linker

I noticed while trying to test against LLVM 5.0 that GHC would throw "Couldn't
figure out linker information" warnings due to LLD being chosen by configure.
Adding detection support to silence these is simple enough, let's just do it.

(cherry picked from commit 6c0db98b)
parent d3573e4a
...@@ -5478,6 +5478,7 @@ isBmi2Enabled dflags = case platformArch (targetPlatform dflags) of ...@@ -5478,6 +5478,7 @@ isBmi2Enabled dflags = case platformArch (targetPlatform dflags) of
data LinkerInfo data LinkerInfo
= GnuLD [Option] = GnuLD [Option]
| GnuGold [Option] | GnuGold [Option]
| LlvmLLD [Option]
| DarwinLD [Option] | DarwinLD [Option]
| SolarisLD [Option] | SolarisLD [Option]
| AixLD [Option] | AixLD [Option]
......
...@@ -96,6 +96,7 @@ https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc.pdf : ...@@ -96,6 +96,7 @@ https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc.pdf :
neededLinkArgs :: LinkerInfo -> [Option] neededLinkArgs :: LinkerInfo -> [Option]
neededLinkArgs (GnuLD o) = o neededLinkArgs (GnuLD o) = o
neededLinkArgs (GnuGold o) = o neededLinkArgs (GnuGold o) = o
neededLinkArgs (LlvmLLD o) = o
neededLinkArgs (DarwinLD o) = o neededLinkArgs (DarwinLD o) = o
neededLinkArgs (SolarisLD o) = o neededLinkArgs (SolarisLD o) = o
neededLinkArgs (AixLD o) = o neededLinkArgs (AixLD o) = o
...@@ -140,6 +141,9 @@ getLinkerInfo' dflags = do ...@@ -140,6 +141,9 @@ getLinkerInfo' dflags = do
-- ELF specific flag, see Note [ELF needed shared libs] -- ELF specific flag, see Note [ELF needed shared libs]
return (GnuGold [Option "-Wl,--no-as-needed"]) return (GnuGold [Option "-Wl,--no-as-needed"])
| any ("LLD" `isPrefixOf`) stdo =
return (LlvmLLD [])
-- Unknown linker. -- Unknown linker.
| otherwise = fail "invalid --version output, or linker is unsupported" | otherwise = fail "invalid --version output, or linker is unsupported"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment