[cfe-commits] r146098 - /cfe/trunk/lib/Driver/Tools.cpp

Daniel Dunbar daniel at zuster.org
Wed Dec 7 15:22:17 PST 2011


Author: ddunbar
Date: Wed Dec  7 17:22:17 2011
New Revision: 146098

URL: http://llvm.org/viewvc/llvm-project?rev=146098&view=rev
Log:
Driver/Linux: Fix the ASAN library path to match current compiler-rt
integration.

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

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=146098&r1=146097&r2=146098&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Dec  7 17:22:17 2011
@@ -1109,11 +1109,13 @@
       !Args.hasFlag(options::OPT_faddress_sanitizer,
                     options::OPT_fno_address_sanitizer, false))
     return;
-  // LibAsan is "../lib/clang/linux/ArchName/libclang_rt.asan.a"
-  llvm::SmallString<128> LibAsan =
-      llvm::sys::path::parent_path(StringRef(TC.getDriver().Dir));
-  llvm::sys::path::append(LibAsan, "lib", "clang", "linux", TC.getArchName());
-  llvm::sys::path::append(LibAsan, "libclang_rt.asan.a");
+
+  // LibAsan is "libclang_rt.asan-<ArchName>.a" in the Linux library resource
+  // directory.
+  llvm::SmallString<128> LibAsan(TC.getDriver().ResourceDir);
+  llvm::sys::path::append(LibAsan, "lib", "linux",
+                          (Twine("libclang_rt.asan-") +
+                           TC.getArchName() + ".a"));
   CmdArgs.push_back(Args.MakeArgString(LibAsan));
   CmdArgs.push_back("-lpthread");
   CmdArgs.push_back("-ldl");





More information about the cfe-commits mailing list