[PATCH] add supporting of the sanitizer arguments into Clang on FreeBSD platform.

Viktor Kutuzov vkutuzov at accesssoftek.com
Fri Mar 7 05:23:34 PST 2014


  Updated to leverage changes by Alexey Samsonov.

  The change in ##getCompilerRTLibDir()## is necessary as otherwise it yields "lib/freebsd10.0" on FreeBSD 10.0 whereas "lib/freebsd" (without the version number) is expected.

  Thanks, Alexey!

Hi kcc, samsonov,

http://llvm-reviews.chandlerc.com/D2644

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D2644?vs=7178&id=7639#toc

Files:
  lib/Driver/Tools.cpp

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -1772,7 +1772,8 @@
 static SmallString<128> getCompilerRTLibDir(const ToolChain &TC) {
   // The runtimes are located in the OS-specific resource directory.
   SmallString<128> Res(TC.getDriver().ResourceDir);
-  llvm::sys::path::append(Res, "lib", TC.getOS());
+  const llvm::Triple &Triple = TC.getTriple();
+  llvm::sys::path::append(Res, "lib", Triple.getOSTypeName(Triple.getOS()));
   return Res;
 }
 
@@ -6230,6 +6231,8 @@
     CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
   }
 
+  addSanitizerRuntimes(getToolChain(), Args, CmdArgs);
+
   addProfileRT(ToolChain, Args, CmdArgs);
 
   const char *Exec =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2644.7.patch
Type: text/x-patch
Size: 788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140307/70bd3b3d/attachment.bin>


More information about the cfe-commits mailing list