[PATCH] D119201: [clang][Fuchsia] Ensure static sanitizer libs are only linked in after the -nostdlib check

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 7 16:08:57 PST 2022

leonardchan created this revision.
leonardchan added reviewers: phosek, mcgrathr.
leonardchan added projects: clang, Sanitizers.
Herald added a subscriber: abrachet.
leonardchan requested review of this revision.

  rG LLVM Github Monorepo



Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -127,7 +127,6 @@
                   D.getLTOMode() == LTOK_Thin);
-  bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
   bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
   ToolChain.addProfileRTLibs(Args, CmdArgs);
@@ -153,6 +152,7 @@
+    bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
     if (NeedsSanitizerDeps)
       linkSanitizerRuntimeDeps(ToolChain, CmdArgs);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119201.406643.patch
Type: text/x-patch
Size: 727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220208/ed7d5404/attachment.bin>

More information about the cfe-commits mailing list