[PATCH] Asan libraries on ARM should (for now) be called generically as "arm".

Renato Golin renato.golin at linaro.org
Fri Jan 31 02:59:32 PST 2014


Hi samsonov, rnk,

ARM arch names can vary greatly, so targeting the specific arch name would force many changes in Compiler-RT's make files. Since the support is still experimental on ARM, we should make it simple for now and call it "arm" on all ARM platforms.

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

Files:
  lib/Driver/Tools.cpp

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -1722,6 +1722,14 @@
     }
 }
 
+// Until ARM libraries are build separately, we have them all in one library
+static StringRef getArchName(const ToolChain &TC) {
+  if (TC.getArch() == llvm::Triple::arm)
+    return "arm";
+  else
+    return TC.getArchName();
+}
+
 static void addProfileRTLinux(
     const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) {
   if (!(Args.hasArg(options::OPT_fprofile_arcs) ||
@@ -1736,7 +1744,7 @@
   SmallString<128> LibProfile(TC.getDriver().ResourceDir);
   llvm::sys::path::append(
       LibProfile, "lib", "linux",
-      Twine("libclang_rt.profile-") + TC.getArchName() + ".a");
+      Twine("libclang_rt.profile-") + getArchName(TC) + ".a");
 
   CmdArgs.push_back(Args.MakeArgString(LibProfile));
 }
@@ -1750,7 +1758,7 @@
   SmallString<128> LibSanitizer(TC.getDriver().ResourceDir);
   llvm::sys::path::append(
       LibSanitizer, "lib", "linux",
-      (Twine("libclang_rt.") + Sanitizer + "-" + TC.getArchName() + ".a"));
+      (Twine("libclang_rt.") + Sanitizer + "-" + getArchName(TC) + ".a"));
 
   // Sanitizer runtime may need to come before -lstdc++ (or -lc++, libstdc++.a,
   // etc.) so that the linker picks custom versions of the global 'operator
@@ -1791,7 +1799,7 @@
     SmallString<128> LibAsan(TC.getDriver().ResourceDir);
     llvm::sys::path::append(LibAsan, "lib", "linux",
         (Twine("libclang_rt.asan-") +
-            TC.getArchName() + "-android.so"));
+            getArchName(TC) + "-android.so"));
     CmdArgs.insert(CmdArgs.begin(), Args.MakeArgString(LibAsan));
   } else {
     if (!Args.hasArg(options::OPT_shared))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2665.1.patch
Type: text/x-patch
Size: 1762 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140131/a31e4d61/attachment.bin>


More information about the llvm-commits mailing list