r200538 - ARM RT libs with generic name
Renato Golin
renato.golin at linaro.org
Fri Jan 31 03:47:28 PST 2014
Author: rengolin
Date: Fri Jan 31 05:47:28 2014
New Revision: 200538
URL: http://llvm.org/viewvc/llvm-project?rev=200538&view=rev
Log:
ARM RT libs with generic name
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=200538&r1=200537&r2=200538&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Jan 31 05:47:28 2014
@@ -1726,6 +1726,14 @@ static void CollectArgsForIntegratedAsse
}
}
+// Until ARM libraries are build separately, we have them all in one library
+static StringRef getArchNameForCompilerRTLib(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) ||
@@ -1740,7 +1748,7 @@ static void addProfileRTLinux(
SmallString<128> LibProfile(TC.getDriver().ResourceDir);
llvm::sys::path::append(
LibProfile, "lib", "linux",
- Twine("libclang_rt.profile-") + TC.getArchName() + ".a");
+ Twine("libclang_rt.profile-") + getArchNameForCompilerRTLib(TC) + ".a");
CmdArgs.push_back(Args.MakeArgString(LibProfile));
}
@@ -1754,7 +1762,8 @@ static void addSanitizerRTLinkFlagsLinux
SmallString<128> LibSanitizer(TC.getDriver().ResourceDir);
llvm::sys::path::append(
LibSanitizer, "lib", "linux",
- (Twine("libclang_rt.") + Sanitizer + "-" + TC.getArchName() + ".a"));
+ (Twine("libclang_rt.") + Sanitizer + "-" +
+ getArchNameForCompilerRTLib(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
@@ -1795,7 +1804,7 @@ static void addAsanRTLinux(const ToolCha
SmallString<128> LibAsan(TC.getDriver().ResourceDir);
llvm::sys::path::append(LibAsan, "lib", "linux",
(Twine("libclang_rt.asan-") +
- TC.getArchName() + "-android.so"));
+ getArchNameForCompilerRTLib(TC) + "-android.so"));
CmdArgs.insert(CmdArgs.begin(), Args.MakeArgString(LibAsan));
} else {
if (!Args.hasArg(options::OPT_shared))
More information about the cfe-commits
mailing list