From: Reid Kleckner Date: Wed, 2 Nov 2016 15:38:51 +0000 (+0000) Subject: [asan] Use the dynamic ASan runtime if -shared-libasan is passed X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54ac10da81f70a7c019c4a65f698da90b6d4fc7c;p=clang [asan] Use the dynamic ASan runtime if -shared-libasan is passed -shared-libasan is likely to be used as a link flag if the user is using the GCC-style clang driver. This logic is already tested in clang-cl tests, and the new flag to exercise it will be covered by asan tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285820 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index b6a8992948..02799380ab 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -10786,7 +10786,8 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (TC.getSanitizerArgs().needsAsanRt()) { CmdArgs.push_back(Args.MakeArgString("-debug")); CmdArgs.push_back(Args.MakeArgString("-incremental:no")); - if (Args.hasArg(options::OPT__SLASH_MD, options::OPT__SLASH_MDd)) { + if (TC.getSanitizerArgs().needsSharedAsanRt() || + Args.hasArg(options::OPT__SLASH_MD, options::OPT__SLASH_MDd)) { for (const auto &Lib : {"asan_dynamic", "asan_dynamic_runtime_thunk"}) CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib)); // Make sure the dynamic runtime thunk is not optimized out at link time