<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Courier New;color: #000000;font-size: 10pt;">
Thanks Yaron. I'll to figure out what's going wrong with<br>
the Linux buildbot and I'll re-commit the fixed patch tomorrow.<br>
<br>
- Vasileios <br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF585637"><font face="Tahoma" color="#000000" size="2"><b>From:</b> Yaron Keren [yaron.keren@gmail.com]<br>
<b>Sent:</b> 02 October 2015 17:46<br>
<b>To:</b> Vasileios Kalintiris<br>
<b>Cc:</b> cfe-commits<br>
<b>Subject:</b> Re: r249141 - Revert "Add support for the new mips-mti-linux toolchain."<br>
</font><br>
</div>
<div></div>
<div>
<div dir="rtl">
<div dir="ltr">The regular expression should match match clang.exe on Windows.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div dir="ltr">2015-10-02 18:00 GMT+03:00 Vasileios Kalintiris via cfe-commits <span dir="ltr">
<<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span>:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Author: vkalintiris<br>
Date: Fri Oct 2 10:00:55 2015<br>
New Revision: 249141<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=249141&view=rev" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=249141&view=rev</a><br>
Log:<br>
Revert "Add support for the new mips-mti-linux toolchain."<br>
<br>
This reverts commit r249137 because it broke the Windows buildbots and<br>
a Linux buildbot for LLD.<br>
<br>
Removed:<br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mips-r2-hard-musl/lib/linux/libclang_rt.builtins-mips.a<br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mips-r2-hard-musl/lib/linux/<a href="http://libclang_rt.builtins-mips.so" rel="noreferrer" target="_blank">libclang_rt.builtins-mips.so</a><br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mipsel-r2-hard-musl/lib/linux/libclang_rt.builtins-mipsel.a<br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mipsel-r2-hard-musl/lib/linux/<a href="http://libclang_rt.builtins-mipsel.so" rel="noreferrer" target="_blank">libclang_rt.builtins-mipsel.so</a><br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crt1.o<br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crti.o<br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crtn.o<br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crt1.o<br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crti.o<br>
cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crtn.o<br>
cfe/trunk/test/Driver/mips-mti-linux.c<br>
Modified:<br>
cfe/trunk/lib/Driver/Driver.cpp<br>
cfe/trunk/lib/Driver/ToolChain.cpp<br>
cfe/trunk/lib/Driver/ToolChains.cpp<br>
cfe/trunk/lib/Driver/ToolChains.h<br>
cfe/trunk/lib/Driver/Tools.cpp<br>
cfe/trunk/lib/Driver/Tools.h<br>
<br>
Modified: cfe/trunk/lib/Driver/Driver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=249141&r1=249140&r2=249141&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=249141&r1=249140&r2=249141&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Driver.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Oct 2 10:00:55 2015<br>
@@ -2122,11 +2122,6 @@ void Driver::generatePrefixedToolNames(<br>
// FIXME: Needs a better variable than DefaultTargetTriple<br>
Names.emplace_back(DefaultTargetTriple + "-" + Tool);<br>
Names.emplace_back(Tool);<br>
-<br>
- // Allow the discovery of tools prefixed with LLVM's default target triple.<br>
- std::string LLVMDefaultTargetTriple = llvm::sys::getDefaultTargetTriple();<br>
- if (LLVMDefaultTargetTriple != DefaultTargetTriple)<br>
- Names.emplace_back(LLVMDefaultTargetTriple + "-" + Tool);<br>
}<br>
<br>
static bool ScanDirForExecutable(SmallString<128> &Dir,<br>
@@ -2222,9 +2217,6 @@ const ToolChain &Driver::getToolChain(co<br>
case llvm::Triple::Linux:<br>
if (Target.getArch() == llvm::Triple::hexagon)<br>
TC = new toolchains::HexagonToolChain(*this, Target, Args);<br>
- else if ((Target.getVendor() == llvm::Triple::MipsTechnologies) &&<br>
- !Target.hasEnvironment())<br>
- TC = new toolchains::MipsLLVMToolChain(*this, Target, Args);<br>
else<br>
TC = new toolchains::Linux(*this, Target, Args);<br>
break;<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChain.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=249141&r1=249140&r2=249141&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=249141&r1=249140&r2=249141&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChain.cpp Fri Oct 2 10:00:55 2015<br>
@@ -315,6 +315,7 @@ Tool *ToolChain::SelectTool(const JobAct<br>
<br>
std::string ToolChain::GetFilePath(const char *Name) const {<br>
return D.GetFilePath(Name, *this);<br>
+<br>
}<br>
<br>
std::string ToolChain::GetProgramPath(const char *Name) const {<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=249141&r1=249140&r2=249141&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=249141&r1=249140&r2=249141&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Oct 2 10:00:55 2015<br>
@@ -1301,9 +1301,8 @@ bool Generic_GCC::GCCInstallationDetecto<br>
"i586-linux-gnu"};<br>
<br>
static const char *const MIPSLibDirs[] = {"/lib"};<br>
- static const char *const MIPSTriples[] = {"mips-linux-gnu", "mips-mti-linux",<br>
- "mips-mti-linux-gnu",<br>
- "mips-img-linux-gnu"};<br>
+ static const char *const MIPSTriples[] = {<br>
+ "mips-linux-gnu", "mips-mti-linux-gnu", "mips-img-linux-gnu"};<br>
static const char *const MIPSELLibDirs[] = {"/lib"};<br>
static const char *const MIPSELTriples[] = {<br>
"mipsel-linux-gnu", "mipsel-linux-android", "mips-img-linux-gnu"};<br>
@@ -1692,32 +1691,6 @@ static bool findMIPSMultilibs(const llvm<br>
});<br>
}<br>
<br>
- // Check for Musl toolchain multilibs<br>
- MultilibSet MuslMipsMultilibs;<br>
- {<br>
- auto MArchMipsR2 = makeMultilib("")<br>
- .osSuffix("/mips-r2-hard-musl")<br>
- .flag("+EB")<br>
- .flag("-EL")<br>
- .flag("+march=mips32r2");<br>
-<br>
- auto MArchMipselR2 = makeMultilib("/mipsel-r2-hard-musl")<br>
- .flag("-EB")<br>
- .flag("+EL")<br>
- .flag("+march=mips32r2");<br>
-<br>
- MuslMipsMultilibs = MultilibSet().Either(MArchMipsR2, MArchMipselR2);<br>
-<br>
- // Specify the callback that computes the include directories.<br>
- MuslMipsMultilibs.setIncludeDirsCallback([](<br>
- StringRef InstallDir, StringRef TripleStr, const Multilib &M) {<br>
- std::vector<std::string> Dirs;<br>
- Dirs.push_back(<br>
- (InstallDir + "/../sysroot" + M.osSuffix() + "/usr/include").str());<br>
- return Dirs;<br>
- });<br>
- }<br>
-<br>
// Check for Code Sourcery toolchain multilibs<br>
MultilibSet CSMipsMultilibs;<br>
{<br>
@@ -1863,16 +1836,6 @@ static bool findMIPSMultilibs(const llvm<br>
return false;<br>
}<br>
<br>
- if (TargetTriple.getVendor() == llvm::Triple::MipsTechnologies &&<br>
- TargetTriple.getOS() == llvm::Triple::Linux &&<br>
- TargetTriple.getEnvironment() == llvm::Triple::UnknownEnvironment) {<br>
- if (MuslMipsMultilibs.select(Flags, Result.SelectedMultilib)) {<br>
- Result.Multilibs = MuslMipsMultilibs;<br>
- return true;<br>
- }<br>
- return false;<br>
- }<br>
-<br>
if (TargetTriple.getVendor() == llvm::Triple::ImaginationTechnologies &&<br>
TargetTriple.getOS() == llvm::Triple::Linux &&<br>
TargetTriple.getEnvironment() == llvm::Triple::GNU) {<br>
@@ -2213,135 +2176,13 @@ void Generic_ELF::addClangTargetOptions(<br>
(getTriple().getOS() == llvm::Triple::Linux &&<br>
(!V.isOlderThan(4, 7, 0) ||<br>
getTriple().getEnvironment() == llvm::Triple::Android)) ||<br>
- getTriple().getOS() == llvm::Triple::NaCl ||<br>
- (getTriple().getVendor() == llvm::Triple::MipsTechnologies &&<br>
- !getTriple().hasEnvironment());<br>
+ getTriple().getOS() == llvm::Triple::NaCl;<br>
<br>
if (DriverArgs.hasFlag(options::OPT_fuse_init_array,<br>
options::OPT_fno_use_init_array, UseInitArrayDefault))<br>
CC1Args.push_back("-fuse-init-array");<br>
}<br>
<br>
-/// Mips Toolchain<br>
-MipsLLVMToolChain::MipsLLVMToolChain(const Driver &D,<br>
- const llvm::Triple &Triple,<br>
- const ArgList &Args)<br>
- : Linux(D, Triple, Args) {<br>
- // Select the correct multilib according to the given arguments.<br>
- DetectedMultilibs Result;<br>
- findMIPSMultilibs(Triple, "", Args, Result);<br>
- Multilibs = Result.Multilibs;<br>
- SelectedMultilib = Result.SelectedMultilib;<br>
-<br>
- // Find out the library suffix based on the ABI.<br>
- LibSuffix = tools::mips::getMipsABILibSuffix(Args, Triple);<br>
- getFilePaths().clear();<br>
- getFilePaths().push_back(computeSysRoot() + "/usr/lib" + LibSuffix);<br>
-<br>
- // Use LLD by default.<br>
- if (!Args.getLastArg(options::OPT_fuse_ld_EQ))<br>
- Linker = GetProgramPath("lld");<br>
-}<br>
-<br>
-void MipsLLVMToolChain::AddClangSystemIncludeArgs(<br>
- const ArgList &DriverArgs, ArgStringList &CC1Args) const {<br>
- if (DriverArgs.hasArg(options::OPT_nostdinc))<br>
- return;<br>
-<br>
- const Driver &D = getDriver();<br>
-<br>
- if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {<br>
- SmallString<128> P(D.ResourceDir);<br>
- llvm::sys::path::append(P, "include");<br>
- addSystemInclude(DriverArgs, CC1Args, P);<br>
- }<br>
-<br>
- if (DriverArgs.hasArg(options::OPT_nostdlibinc))<br>
- return;<br>
-<br>
- const auto &Callback = Multilibs.includeDirsCallback();<br>
- if (Callback) {<br>
- const auto IncludePaths =<br>
- Callback(D.getInstalledDir(), getTripleString(), SelectedMultilib);<br>
- for (const auto &Path : IncludePaths)<br>
- addExternCSystemIncludeIfExists(DriverArgs, CC1Args, Path);<br>
- }<br>
-}<br>
-<br>
-Tool *MipsLLVMToolChain::buildLinker() const {<br>
- return new tools::gnutools::Linker(*this);<br>
-}<br>
-<br>
-std::string MipsLLVMToolChain::computeSysRoot() const {<br>
- if (!getDriver().SysRoot.empty())<br>
- return getDriver().SysRoot + SelectedMultilib.osSuffix();<br>
-<br>
- const std::string InstalledDir(getDriver().getInstalledDir());<br>
- std::string SysRootPath =<br>
- InstalledDir + "/../sysroot" + SelectedMultilib.osSuffix();<br>
- if (llvm::sys::fs::exists(SysRootPath))<br>
- return SysRootPath;<br>
-<br>
- return std::string();<br>
-}<br>
-<br>
-ToolChain::CXXStdlibType<br>
-MipsLLVMToolChain::GetCXXStdlibType(const ArgList &Args) const {<br>
- Arg *A = Args.getLastArg(options::OPT_stdlib_EQ);<br>
- if (A) {<br>
- StringRef Value = A->getValue();<br>
- if (Value != "libc++")<br>
- getDriver().Diag(diag::err_drv_invalid_stdlib_name)<br>
- << A->getAsString(Args);<br>
- }<br>
-<br>
- return ToolChain::CST_Libcxx;<br>
-}<br>
-<br>
-void MipsLLVMToolChain::AddClangCXXStdlibIncludeArgs(<br>
- const ArgList &DriverArgs, ArgStringList &CC1Args) const {<br>
- if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||<br>
- DriverArgs.hasArg(options::OPT_nostdincxx))<br>
- return;<br>
-<br>
- assert((GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) &&<br>
- "Only -lc++ (aka libcxx) is suported in this toolchain.");<br>
-<br>
- const auto &Callback = Multilibs.includeDirsCallback();<br>
- if (Callback) {<br>
- const auto IncludePaths = Callback(getDriver().getInstalledDir(),<br>
- getTripleString(), SelectedMultilib);<br>
- for (const auto &Path : IncludePaths) {<br>
- if (llvm::sys::fs::exists(Path + "/c++/v1")) {<br>
- addSystemInclude(DriverArgs, CC1Args, Path + "/c++/v1");<br>
- break;<br>
- }<br>
- }<br>
- }<br>
-}<br>
-<br>
-void MipsLLVMToolChain::AddCXXStdlibLibArgs(const ArgList &Args,<br>
- ArgStringList &CmdArgs) const {<br>
- assert((GetCXXStdlibType(Args) == ToolChain::CST_Libcxx) &&<br>
- "Only -lc++ (aka libxx) is suported in this toolchain.");<br>
-<br>
- CmdArgs.push_back("-lc++");<br>
- CmdArgs.push_back("-lc++abi");<br>
- CmdArgs.push_back("-lunwind");<br>
-}<br>
-<br>
-std::string MipsLLVMToolChain::getCompilerRT(const ArgList &Args,<br>
- StringRef Component,<br>
- bool Shared) const {<br>
- SmallString<128> Path(getDriver().ResourceDir);<br>
- llvm::sys::path::append(Path, SelectedMultilib.osSuffix(), "lib" + LibSuffix,<br>
- getOS());<br>
- llvm::sys::path::append(Path, Twine("libclang_rt." + Component + "-" +<br>
- getTriple().getArchName() +<br>
- (Shared ? ".so" : ".a")));<br>
- return Path.str();<br>
-}<br>
-<br>
/// Hexagon Toolchain<br>
<br>
std::string HexagonToolChain::GetGnuDir(const std::string &InstalledDir,<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=249141&r1=249140&r2=249141&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=249141&r1=249140&r2=249141&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains.h (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains.h Fri Oct 2 10:00:55 2015<br>
@@ -724,7 +724,6 @@ public:<br>
llvm::opt::ArgStringList &CC1Args) const override;<br>
bool isPIEDefault() const override;<br>
SanitizerMask getSupportedSanitizers() const override;<br>
- virtual std::string computeSysRoot() const;<br>
<br>
std::string Linker;<br>
std::vector<std::string> ExtraOpts;<br>
@@ -742,6 +741,7 @@ private:<br>
const llvm::opt::ArgList &DriverArgs,<br>
llvm::opt::ArgStringList &CC1Args);<br>
<br>
+ std::string computeSysRoot() const;<br>
};<br>
<br>
class LLVM_LIBRARY_VISIBILITY CudaToolChain : public Linux {<br>
@@ -756,42 +756,6 @@ public:<br>
llvm::opt::ArgStringList &CC1Args) const override;<br>
};<br>
<br>
-class LLVM_LIBRARY_VISIBILITY MipsLLVMToolChain : public Linux {<br>
-protected:<br>
- Tool *buildLinker() const override;<br>
-<br>
-public:<br>
- MipsLLVMToolChain(const Driver &D, const llvm::Triple &Triple,<br>
- const llvm::opt::ArgList &Args);<br>
-<br>
- void<br>
- AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,<br>
- llvm::opt::ArgStringList &CC1Args) const override;<br>
-<br>
- CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;<br>
-<br>
- void AddClangCXXStdlibIncludeArgs(<br>
- const llvm::opt::ArgList &DriverArgs,<br>
- llvm::opt::ArgStringList &CC1Args) const override;<br>
-<br>
- void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,<br>
- llvm::opt::ArgStringList &CmdArgs) const override;<br>
-<br>
- std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,<br>
- bool Shared = false) const override;<br>
-<br>
- std::string computeSysRoot() const override;<br>
-<br>
- RuntimeLibType GetDefaultRuntimeLibType() const override {<br>
- return GCCInstallation.isValid() ? RuntimeLibType::RLT_Libgcc<br>
- : RuntimeLibType::RLT_CompilerRT;<br>
- }<br>
-<br>
-private:<br>
- Multilib SelectedMultilib;<br>
- std::string LibSuffix;<br>
-};<br>
-<br>
class LLVM_LIBRARY_VISIBILITY HexagonToolChain : public Linux {<br>
protected:<br>
GCCVersion GCCLibAndIncVersion;<br>
<br>
Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=249141&r1=249140&r2=249141&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=249141&r1=249140&r2=249141&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Oct 2 10:00:55 2015<br>
@@ -1077,16 +1077,6 @@ void mips::getMipsCPUAndABI(const ArgLis<br>
// FIXME: Warn on inconsistent use of -march and -mabi.<br>
}<br>
<br>
-std::string mips::getMipsABILibSuffix(const ArgList &Args,<br>
- const llvm::Triple &Triple) {<br>
- StringRef CPUName, ABIName;<br>
- tools::mips::getMipsCPUAndABI(Args, Triple, CPUName, ABIName);<br>
- return llvm::StringSwitch<std::string>(ABIName)<br>
- .Case("o32", "")<br>
- .Case("n32", "32")<br>
- .Case("n64", "64");<br>
-}<br>
-<br>
// Convert ABI name to the GNU tools acceptable variant.<br>
static StringRef getGnuCompatibleMipsABIName(StringRef ABI) {<br>
return llvm::StringSwitch<llvm::StringRef>(ABI)<br>
@@ -4569,16 +4559,12 @@ void Clang::ConstructJob(Compilation &C,<br>
}<br>
<br>
// -fuse-cxa-atexit is default.<br>
- if (!Args.hasFlag(<br>
- options::OPT_fuse_cxa_atexit, options::OPT_fno_use_cxa_atexit,<br>
- !IsWindowsCygnus && !IsWindowsGNU &&<br>
- getToolChain().getTriple().getOS() != llvm::Triple::Solaris &&<br>
- getToolChain().getArch() != llvm::Triple::hexagon &&<br>
- getToolChain().getArch() != llvm::Triple::xcore &&<br>
- getToolChain().getArch() != llvm::Triple::xcore &&<br>
- ((getToolChain().getTriple().getVendor() !=<br>
- llvm::Triple::MipsTechnologies) ||<br>
- getToolChain().getTriple().hasEnvironment())) ||<br>
+ if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,<br>
+ options::OPT_fno_use_cxa_atexit,<br>
+ !IsWindowsCygnus && !IsWindowsGNU &&<br>
+ getToolChain().getTriple().getOS() != llvm::Triple::Solaris &&<br>
+ getToolChain().getArch() != llvm::Triple::hexagon &&<br>
+ getToolChain().getArch() != llvm::Triple::xcore) ||<br>
KernelOrKext)<br>
CmdArgs.push_back("-fno-use-cxa-atexit");<br>
<br>
@@ -8150,17 +8136,20 @@ static std::string getLinuxDynamicLinker<br>
return "/lib/ld-linux.so.3";<br>
} else if (Arch == llvm::Triple::mips || Arch == llvm::Triple::mipsel ||<br>
Arch == llvm::Triple::mips64 || Arch == llvm::Triple::mips64el) {<br>
- std::string LibDir =<br>
- "/lib" + mips::getMipsABILibSuffix(Args, ToolChain.getTriple());<br>
- StringRef LibName;<br>
+ StringRef CPUName;<br>
+ StringRef ABIName;<br>
+ mips::getMipsCPUAndABI(Args, ToolChain.getTriple(), CPUName, ABIName);<br>
bool IsNaN2008 = mips::isNaN2008(Args, ToolChain.getTriple());<br>
+<br>
+ StringRef LibDir = llvm::StringSwitch<llvm::StringRef>(ABIName)<br>
+ .Case("o32", "/lib")<br>
+ .Case("n32", "/lib32")<br>
+ .Case("n64", "/lib64")<br>
+ .Default("/lib");<br>
+ StringRef LibName;<br>
if (mips::isUCLibc(Args))<br>
LibName = IsNaN2008 ? "ld-uClibc-mipsn8.so.0" : "ld-uClibc.so.0";<br>
- else if (!ToolChain.getTriple().hasEnvironment()) {<br>
- bool LE = (ToolChain.getTriple().getArch() == llvm::Triple::mipsel) ||<br>
- (ToolChain.getTriple().getArch() == llvm::Triple::mips64el);<br>
- LibName = LE ? "ld-musl-mipsel.so.1" : "ld-musl-mips.so.1";<br>
- } else<br>
+ else<br>
LibName = IsNaN2008 ? "ld-linux-mipsn8.so.1" : "ld.so.1";<br>
<br>
return (LibDir + "/" + LibName).str();<br>
@@ -8273,9 +8262,6 @@ void gnutools::Linker::ConstructJob(Comp<br>
const bool IsPIE =<br>
!Args.hasArg(options::OPT_shared) && !Args.hasArg(options::OPT_static) &&<br>
(Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault());<br>
- const bool HasCRTBeginEndFiles =<br>
- ToolChain.getTriple().hasEnvironment() ||<br>
- (ToolChain.getTriple().getVendor() != llvm::Triple::MipsTechnologies);<br>
<br>
ArgStringList CmdArgs;<br>
<br>
@@ -8287,13 +8273,6 @@ void gnutools::Linker::ConstructJob(Comp<br>
// handled somewhere else.<br>
Args.ClaimAllArgs(options::OPT_w);<br>
<br>
- if (llvm::sys::path::filename(ToolChain.Linker) == "lld") {<br>
- CmdArgs.push_back("-flavor");<br>
- CmdArgs.push_back("gnu");<br>
- CmdArgs.push_back("-target");<br>
- CmdArgs.push_back(Args.MakeArgString(getToolChain().getTripleString()));<br>
- }<br>
-<br>
if (!D.SysRoot.empty())<br>
CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));<br>
<br>
@@ -8368,9 +8347,7 @@ void gnutools::Linker::ConstructJob(Comp<br>
crtbegin = isAndroid ? "crtbegin_dynamic.o" : "crtbeginS.o";<br>
else<br>
crtbegin = isAndroid ? "crtbegin_dynamic.o" : "crtbegin.o";<br>
-<br>
- if (HasCRTBeginEndFiles)<br>
- CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));<br>
+ CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));<br>
<br>
// Add crtfastmath.o if available and fast math is enabled.<br>
ToolChain.AddFastMathRuntimeIfAvailable(Args, CmdArgs);<br>
@@ -8469,13 +8446,11 @@ void gnutools::Linker::ConstructJob(Comp<br>
else<br>
crtend = isAndroid ? "crtend_android.o" : "crtend.o";<br>
<br>
- if (HasCRTBeginEndFiles)<br>
- CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));<br>
+ CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));<br>
if (!isAndroid)<br>
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));<br>
}<br>
- } else if (Args.hasArg(options::OPT_rtlib_EQ))<br>
- AddRunTimeLibs(ToolChain, D, CmdArgs, Args);<br>
+ }<br>
<br>
C.addCommand(llvm::make_unique<Command>(JA, *this, ToolChain.Linker.c_str(),<br>
CmdArgs, Inputs));<br>
<br>
Modified: cfe/trunk/lib/Driver/Tools.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=249141&r1=249140&r2=249141&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=249141&r1=249140&r2=249141&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Tools.h (original)<br>
+++ cfe/trunk/lib/Driver/Tools.h Fri Oct 2 10:00:55 2015<br>
@@ -267,8 +267,6 @@ NanEncoding getSupportedNanEncoding(Stri<br>
void getMipsCPUAndABI(const llvm::opt::ArgList &Args,<br>
const llvm::Triple &Triple, StringRef &CPUName,<br>
StringRef &ABIName);<br>
-std::string getMipsABILibSuffix(const llvm::opt::ArgList &Args,<br>
- const llvm::Triple &Triple);<br>
bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value);<br>
bool isUCLibc(const llvm::opt::ArgList &Args);<br>
bool isNaN2008(const llvm::opt::ArgList &Args, const llvm::Triple &Triple);<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mips-r2-hard-musl/lib/linux/libclang_rt.builtins-mips.a<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mips-r2-hard-musl/lib/linux/libclang_rt.builtins-mips.a?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mips-r2-hard-musl/lib/linux/libclang_rt.builtins-mips.a?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mips-r2-hard-musl/lib/linux/<a href="http://libclang_rt.builtins-mips.so" rel="noreferrer" target="_blank">libclang_rt.builtins-mips.so</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mips-r2-hard-musl/lib/linux/libclang_rt.builtins-mips.so?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mips-r2-hard-musl/lib/linux/libclang_rt.builtins-mips.so?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mipsel-r2-hard-musl/lib/linux/libclang_rt.builtins-mipsel.a<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mipsel-r2-hard-musl/lib/linux/libclang_rt.builtins-mipsel.a?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mipsel-r2-hard-musl/lib/linux/libclang_rt.builtins-mipsel.a?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mipsel-r2-hard-musl/lib/linux/<a href="http://libclang_rt.builtins-mipsel.so" rel="noreferrer" target="_blank">libclang_rt.builtins-mipsel.so</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mipsel-r2-hard-musl/lib/linux/libclang_rt.builtins-mipsel.so?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/lib/clang/3.8.0/mipsel-r2-hard-musl/lib/linux/libclang_rt.builtins-mipsel.so?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crt1.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crt1.o?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crt1.o?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crti.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crti.o?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crti.o?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crtn.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crtn.o?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mips-r2-hard-musl/usr/lib/crtn.o?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crt1.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crt1.o?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crt1.o?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crti.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crti.o?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crti.o?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crtn.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crtn.o?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/mips_mti_linux/sysroot/mipsel-r2-hard-musl/usr/lib/crtn.o?rev=249140&view=auto</a><br>
==============================================================================<br>
(empty)<br>
<br>
Removed: cfe/trunk/test/Driver/mips-mti-linux.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-mti-linux.c?rev=249140&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-mti-linux.c?rev=249140&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/mips-mti-linux.c (original)<br>
+++ cfe/trunk/test/Driver/mips-mti-linux.c (removed)<br>
@@ -1,42 +0,0 @@<br>
-// Check frontend and linker invocations on GPL-free MIPS toolchain.<br>
-//<br>
-// FIXME: Using --sysroot with this toolchain/triple isn't supported. We use<br>
-// it here to test that we are producing the correct paths/flags.<br>
-// Ideally, we'd like to have an --llvm-toolchain option similar to<br>
-// the --gcc-toolchain one.<br>
-<br>
-// = Big-endian, mips32r2, hard float<br>
-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
-// RUN: --target=mips-mti-linux -mips32r2 -mhard-float \<br>
-// RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \<br>
-// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s<br>
-//<br>
-// CHECK-BE-HF-32R2: "{{.*}}clang" {{.*}} "-triple" "mips-mti-linux"<br>
-// CHECK-BE-HF-32R2-SAME: "-fuse-init-array" "-target-cpu" "mips32r2"<br>
-// CHECK-BE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot"<br>
-// CHECK-BE-HF-32R2: "lld" "-flavor" "gnu" "-target" "mips-mti-linux"<br>
-// CHECK-BE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mips.so.1"<br>
-// CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib/crt1.o"<br>
-// CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib/crti.o"<br>
-// CHECK-BE-HF-32R2-SAME: "-L[[SYSROOT]]/mips-r2-hard-musl/usr/lib"<br>
-// CHECK-BE-HF-32R2-SAME: "{{[^"]+}}/mips-r2-hard-musl/lib/linux/libclang_rt.builtins-mips.a"<br>
-// CHECK-BE-HF-32R2-SAME: "-lc"<br>
-// CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib/crtn.o"<br>
-<br>
-// = Little-endian, mips32r2, hard float<br>
-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
-// RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float \<br>
-// RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \<br>
-// RUN: | FileCheck --check-prefix=CHECK-LE-HF-32R2 %s<br>
-//<br>
-// CHECK-LE-HF-32R2: "{{.*}}clang" {{.*}} "-triple" "mipsel-mti-linux"<br>
-// CHECK-LE-HF-32R2-SAME: "-fuse-init-array" "-target-cpu" "mips32r2"<br>
-// CHECK-LE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot"<br>
-// CHECK-LE-HF-32R2: "lld" "-flavor" "gnu" "-target" "mipsel-mti-linux"<br>
-// CHECK-LE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mipsel.so.1"<br>
-// CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib/crt1.o"<br>
-// CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib/crti.o"<br>
-// CHECK-LE-HF-32R2-SAME: "-L[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib"<br>
-// CHECK-LE-HF-32R2-SAME: "{{[^"]+}}/mipsel-r2-hard-musl/lib/linux/libclang_rt.builtins-mipsel.a"<br>
-// CHECK-LE-HF-32R2-SAME: "-lc"<br>
-// CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib/crtn.o"<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>