summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-28 23:14:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-28 23:14:34 +0000
commita839855b5683cd80476eee736573787c2aae7484 (patch)
tree12935880e352ec50ab6c113466cfa25d67d14ea8 /clang/lib
parent48cbda5850264671e982ecdd834c1587b1732c15 (diff)
downloadbcm5719-llvm-a839855b5683cd80476eee736573787c2aae7484.tar.gz
bcm5719-llvm-a839855b5683cd80476eee736573787c2aae7484.zip
Revert "Support cross linking to arm on ubuntu."
This reverts commit r193528 (and fixes). It broke Chandler's setup. llvm-svn: 193554
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/ToolChains.cpp34
1 files changed, 11 insertions, 23 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index e99c1f0e9ab..76794535ba8 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -2127,9 +2127,9 @@ static bool IsUbuntu(enum Distro Distro) {
return Distro >= UbuntuHardy && Distro <= UbuntuSaucy;
}
-static Distro DetectDistro(StringRef Prefix, llvm::Triple::ArchType Arch) {
+static Distro DetectDistro(llvm::Triple::ArchType Arch) {
OwningPtr<llvm::MemoryBuffer> File;
- if (!llvm::MemoryBuffer::getFile(Prefix + "/etc/lsb-release", File)) {
+ if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
StringRef Data = File.get()->getBuffer();
SmallVector<StringRef, 8> Lines;
Data.split(Lines, "\n");
@@ -2153,7 +2153,7 @@ static Distro DetectDistro(StringRef Prefix, llvm::Triple::ArchType Arch) {
return Version;
}
- if (!llvm::MemoryBuffer::getFile(Prefix + "/etc/redhat-release", File)) {
+ if (!llvm::MemoryBuffer::getFile("/etc/redhat-release", File)) {
StringRef Data = File.get()->getBuffer();
if (Data.startswith("Fedora release"))
return Fedora;
@@ -2171,7 +2171,7 @@ static Distro DetectDistro(StringRef Prefix, llvm::Triple::ArchType Arch) {
return UnknownDistro;
}
- if (!llvm::MemoryBuffer::getFile(Prefix + "/etc/debian_version", File)) {
+ if (!llvm::MemoryBuffer::getFile("/etc/debian_version", File)) {
StringRef Data = File.get()->getBuffer();
if (Data[0] == '5')
return DebianLenny;
@@ -2184,13 +2184,13 @@ static Distro DetectDistro(StringRef Prefix, llvm::Triple::ArchType Arch) {
return UnknownDistro;
}
- if (llvm::sys::fs::exists(Prefix + "/etc/SuSE-release"))
+ if (llvm::sys::fs::exists("/etc/SuSE-release"))
return OpenSUSE;
- if (llvm::sys::fs::exists(Prefix + "/etc/exherbo-release"))
+ if (llvm::sys::fs::exists("/etc/exherbo-release"))
return Exherbo;
- if (llvm::sys::fs::exists(Prefix + "/etc/arch-release"))
+ if (llvm::sys::fs::exists("/etc/arch-release"))
return ArchLinux;
return UnknownDistro;
@@ -2265,14 +2265,9 @@ static void addPathIfExists(Twine Path, ToolChain::path_list &Paths) {
}
static StringRef getMultilibDir(const llvm::Triple &Triple,
- bool IsBiarch,
const ArgList &Args) {
- if (!isMipsArch(Triple.getArch())) {
- if (!IsBiarch)
- return "lib";
-
+ if (!isMipsArch(Triple.getArch()))
return Triple.isArch32Bit() ? "lib32" : "lib64";
- }
// lib32 directory has a special meaning on MIPS targets.
// It contains N32 ABI binaries. Use this folder if produce
@@ -2302,7 +2297,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
Linker = GetProgramPath("ld");
- Distro Distro = DetectDistro(SysRoot, Arch);
+ Distro Distro = DetectDistro(Arch);
if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
ExtraOpts.push_back("-z");
@@ -2351,15 +2346,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
// possible permutations of these directories, and seeing which ones it added
// to the link paths.
path_list &Paths = getFilePaths();
- bool IsBiarch;
- if (IsRedhat(Distro))
- IsBiarch = true;
- else if (GCCInstallation.isValid())
- IsBiarch = !GCCInstallation.getBiarchSuffix().empty();
- else
- IsBiarch = true; // FIXME: is this a reasonable fallback?
- const std::string Multilib = getMultilibDir(Triple, IsBiarch, Args);
+ const std::string Multilib = getMultilibDir(Triple, Args);
const std::string MultiarchTriple = getMultiarchTriple(Triple, SysRoot);
// Add the multilib suffixed paths where they are available.
@@ -2431,7 +2419,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
// Add the non-multilib suffixed paths (if potentially different).
const std::string &LibPath = GCCInstallation.getParentLibPath();
const llvm::Triple &GCCTriple = GCCInstallation.getTriple();
- if (IsBiarch)
+ if (!GCCInstallation.getBiarchSuffix().empty())
addPathIfExists(GCCInstallation.getInstallPath() +
GCCInstallation.getMultiLibSuffix(), Paths);
OpenPOWER on IntegriCloud