Index: cfe/trunk/lib/Driver/Tools.cpp =================================================================== --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -11002,6 +11002,11 @@ } else { for (const auto &Lib : {"asan", "asan_cxx"}) CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib)); + // Make sure the linker consider all object files from the static library. + // This is necessary because instrumented dlls need access to all the + // interface exported by the static lib in the main executable. + CmdArgs.push_back(Args.MakeArgString(std::string("-wholearchive:") + + TC.getCompilerRT(Args, "asan"))); } }