diff options
author | Ben Gamari <ben@smart-cactus.org> | 2018-01-21 13:31:29 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-01-21 13:31:38 -0500 |
commit | 6c0db98bc5d1dceb8fa48544532f85d386900e4a (patch) | |
tree | 823982b613fd0acd0f5d37852a3f5d01c7aaad6d /compiler | |
parent | 88297438d550a93f72261447a215b6a58b4fae55 (diff) | |
download | haskell-6c0db98bc5d1dceb8fa48544532f85d386900e4a.tar.gz |
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.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/DynFlags.hs | 1 | ||||
-rw-r--r-- | compiler/main/SysTools/Info.hs | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 77837e6d3d..05d1ec10bc 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -5481,6 +5481,7 @@ isBmi2Enabled dflags = case platformArch (targetPlatform dflags) of data LinkerInfo = GnuLD [Option] | GnuGold [Option] + | LlvmLLD [Option] | DarwinLD [Option] | SolarisLD [Option] | AixLD [Option] diff --git a/compiler/main/SysTools/Info.hs b/compiler/main/SysTools/Info.hs index e9dc68508b..6b310578ff 100644 --- a/compiler/main/SysTools/Info.hs +++ b/compiler/main/SysTools/Info.hs @@ -96,6 +96,7 @@ https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc.pdf : neededLinkArgs :: LinkerInfo -> [Option] neededLinkArgs (GnuLD o) = o neededLinkArgs (GnuGold o) = o +neededLinkArgs (LlvmLLD o) = o neededLinkArgs (DarwinLD o) = o neededLinkArgs (SolarisLD o) = o neededLinkArgs (AixLD o) = o @@ -140,6 +141,9 @@ getLinkerInfo' dflags = do -- ELF specific flag, see Note [ELF needed shared libs] return (GnuGold [Option "-Wl,--no-as-needed"]) + | any ("LLD" `isPrefixOf`) stdo = + return (LlvmLLD []) + -- Unknown linker. | otherwise = fail "invalid --version output, or linker is unsupported" |