ARM RT libs with generic name

llvm-svn: 200538
This commit is contained in:
Renato Golin 2014-01-31 11:47:28 +00:00
parent fd99206ee4
commit e807c12c7a
1 changed files with 12 additions and 3 deletions

View File

@ -1726,6 +1726,14 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
}
}
// 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 ToolChain &TC, const ArgList &Args,
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))