Use --no-as-needed with LLD too
authorSimon Marlow <marlowsd@gmail.com>
Sat, 8 Dec 2018 04:25:40 +0000 (23:25 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sat, 8 Dec 2018 04:25:41 +0000 (23:25 -0500)
Test Plan: validate using LLD as the linker (TODO)

Reviewers: bgamari, angerman, kavon, erikd

Reviewed By: bgamari

Subscribers: watashi, rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5336

compiler/main/SysTools/Info.hs

index 6b31057..420a2bf 100644 (file)
@@ -142,7 +142,9 @@ getLinkerInfo' dflags = do
           return (GnuGold [Option "-Wl,--no-as-needed"])
 
         | any ("LLD" `isPrefixOf`) stdo =
-          return (LlvmLLD [])
+          return (LlvmLLD $ map Option [
+                                      -- see Note [ELF needed shared libs]
+                                      "-Wl,--no-as-needed"])
 
          -- Unknown linker.
         | otherwise = fail "invalid --version output, or linker is unsupported"