[PATCH] D29334: [asan] Ensure we export all the interface when considering the static library.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 10:43:11 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL293668: [windows] [asan] Add wholearchive flag when including static lib asan. (authored by mpividori).

Changed prior to commit:
  https://reviews.llvm.org/D29334?vs=86449&id=86462#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29334

Files:
  cfe/trunk/lib/Driver/Tools.cpp


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")));
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29334.86462.patch
Type: text/x-patch
Size: 698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170131/f009cc59/attachment.bin>


More information about the llvm-commits mailing list