r217679 - [ASan/Win] Fix PR20918 -- SEH handler doesn't work with the MD runtime
Timur Iskhodzhanov
timurrrr at google.com
Fri Sep 12 07:01:31 PDT 2014
Author: timurrrr
Date: Fri Sep 12 09:01:30 2014
New Revision: 217679
URL: http://llvm.org/viewvc/llvm-project?rev=217679&view=rev
Log:
[ASan/Win] Fix PR20918 -- SEH handler doesn't work with the MD runtime
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/cl-link.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=217679&r1=217678&r2=217679&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Sep 12 09:01:30 2014
@@ -7822,6 +7822,9 @@ void visualstudio::Link::ConstructJob(Co
addSanitizerRTWindows(getToolChain(), Args, CmdArgs, "asan_dynamic-i386");
addSanitizerRTWindows(getToolChain(), Args, CmdArgs,
"asan_dynamic_runtime_thunk-i386");
+ // Make sure the dynamic runtime thunk is not optimized out at link time
+ // to ensure proper SEH handling.
+ CmdArgs.push_back(Args.MakeArgString("-include:___asan_seh_interceptor"));
} else if (DLL) {
addSanitizerRTWindows(getToolChain(), Args, CmdArgs,
"asan_dll_thunk-i386");
Modified: cfe/trunk/test/Driver/cl-link.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-link.c?rev=217679&r1=217678&r2=217679&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-link.c (original)
+++ cfe/trunk/test/Driver/cl-link.c Fri Sep 12 09:01:30 2014
@@ -25,6 +25,7 @@
// ASAN-MD: "-incremental:no"
// ASAN-MD: "{{.*}}clang_rt.asan_dynamic-i386.lib"
// ASAN-MD: "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
+// ASAN-MD: "-include:___asan_seh_interceptor"
// ASAN-MD: "{{.*}}cl-link{{.*}}.obj"
// RUN: %clang_cl /LD -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
More information about the cfe-commits
mailing list