From: Petr Hosek Date: Wed, 21 Nov 2018 04:33:44 +0000 (+0000) Subject: [Driver] Link sanitizer runtime deps on Fuchsia when needed X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d5099826365b50ff253e48c0832255600e68202;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347378 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains/Fuchsia.cpp b/lib/Driver/ToolChains/Fuchsia.cpp index cfda9b4f3a..c5f6caf553 100644 --- a/lib/Driver/ToolChains/Fuchsia.cpp +++ b/lib/Driver/ToolChains/Fuchsia.cpp @@ -109,8 +109,7 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA, 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(Compilation &C, const JobAction &JA, } } + if (NeedSanitizerDeps) + linkSanitizerRuntimeDeps(ToolChain, CmdArgs); + AddRunTimeLibs(ToolChain, D, CmdArgs, Args); if (Args.hasArg(options::OPT_pthread) ||