r347378 - [Driver] Link sanitizer runtime deps on Fuchsia when needed

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 20 20:33:44 PST 2018


Author: phosek
Date: Tue Nov 20 20:33:44 2018
New Revision: 347378

URL: http://llvm.org/viewvc/llvm-project?rev=347378&view=rev
Log:
[Driver] Link sanitizer runtime deps on Fuchsia when needed

Even though these deps weren't needed, this makes Fuchsia driver
better match other drivers, and it may be necessary when trying to
use different C libraries on Fuchsia.

Differential Revision: https://reviews.llvm.org/D54741

Modified:
    cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=347378&r1=347377&r2=347378&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Tue Nov 20 20:33:44 2018
@@ -109,8 +109,7 @@ void fuchsia::Linker::ConstructJob(Compi
                   D.getLTOMode() == LTOK_Thin);
   }
 
-  addSanitizerRuntimes(ToolChain, Args, CmdArgs);
-
+  bool NeedSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
   ToolChain.addProfileRTLibs(Args, CmdArgs);
 
@@ -134,6 +133,9 @@ void fuchsia::Linker::ConstructJob(Compi
       }
     }
 
+    if (NeedSanitizerDeps)
+      linkSanitizerRuntimeDeps(ToolChain, CmdArgs);
+
     AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
 
     if (Args.hasArg(options::OPT_pthread) ||




More information about the cfe-commits mailing list