From 324cc03788cbf97f680511b6a91adccff9d9c261 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 28 Aug 2013 17:36:07 +0000 Subject: [PATCH] clang-cl: Pass -debug to the linker when using -fsanitize=address git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189496 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 1 + test/Driver/cl-link.c | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index c30c45d26b..6862e76df6 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -6569,6 +6569,7 @@ void visualstudio::Link::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-nologo"); if (getToolChain().getDriver().getOrParseSanitizerArgs(Args).needsAsanRt()) { + CmdArgs.push_back(Args.MakeArgString("-debug")); SmallString<128> LibSanitizer(getToolChain().getDriver().ResourceDir); // FIXME: Handle 64-bit. Use asan_dll_thunk.dll when building a DLL. llvm::sys::path::append( diff --git a/test/Driver/cl-link.c b/test/Driver/cl-link.c index 76f4f8b27c..b6d14d6dff 100644 --- a/test/Driver/cl-link.c +++ b/test/Driver/cl-link.c @@ -13,5 +13,6 @@ // RUN: %clang_cl /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN %s // ASAN: link.exe +// ASAN: "-debug" // ASAN: "{{.*}}clang_rt.asan-i386.lib" // ASAN: "{{.*}}cl-link{{.*}}.obj" -- 2.40.0