summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-10-03 09:00:50 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-10-03 09:00:50 +0000
commit2356b2c307963c543f374e66ae161164eddb94ce (patch)
treeebfb30b14b52ddbc0f6ad70727642922f0d2d702 /clang/lib/Driver/ToolChains.cpp
parent35cd702e739b89bba28540e6e201286c7704d4fc (diff)
downloadbcm5719-llvm-2356b2c307963c543f374e66ae161164eddb94ce.tar.gz
bcm5719-llvm-2356b2c307963c543f374e66ae161164eddb94ce.zip
Enable generic multilib support on 32bit hosts. Previously this was only
enabled for debian hosts, which is quite odd. I think all restriction on when Clang attempts to use a multilib installation should go away. Clang is fundamentally a cross compiler. It behaves more like GCC when built as a cross compiler, and so it should just use multilib installs when they are present on the system. However, there is a very specific exemption for Exherbo, which I can't test on, so I'm leaving that in place. With this, check in a generic test tree for multilib on a 32-bit host. This stubs out many directories that most distributions don't use but that uptsream GCC supports. This is intended to be an agnostic test that the driver behaves properly compared with the GCC driver it aims for compatibility with. Also, fix a bug in the driver that this testing exposed (see!) where it was incorrectly testing the target architecture rather than the host architecture. If anyone is having trouble with the tree-structure stubs I'm creating to test this, let me know and I can revisit the design. I chose this over (for example) a tar-ball in order to make tests run faster at the small, hopefully amortized VCS cost. llvm-svn: 140999
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r--clang/lib/Driver/ToolChains.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index c6adbc04a8e..51dd4c8c491 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -1378,25 +1378,17 @@ static bool IsUbuntu(enum LinuxDistro Distro) {
Distro == UbuntuNatty || Distro == UbuntuOneiric;
}
-static bool IsDebianBased(enum LinuxDistro Distro) {
- return IsDebian(Distro) || IsUbuntu(Distro);
-}
-
+// FIXME: This should be deleted. We should assume a multilib environment, and
+// fallback gracefully if any parts of it are absent.
static bool HasMultilib(llvm::Triple::ArchType Arch, enum LinuxDistro Distro) {
if (Arch == llvm::Triple::x86_64) {
bool Exists;
if (Distro == Exherbo &&
(llvm::sys::fs::exists("/usr/lib32/libc.so", Exists) || !Exists))
return false;
-
- return true;
}
- if (Arch == llvm::Triple::ppc64)
- return true;
- if ((Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc) &&
- IsDebianBased(Distro))
- return true;
- return false;
+
+ return true;
}
static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
@@ -1690,7 +1682,7 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
getArch() == llvm::Triple::ppc);
const std::string Suffix32 = Arch == llvm::Triple::x86_64 ? "/32" : "";
- const std::string Suffix64 = Is32Bits ? "/64" : "";
+ const std::string Suffix64 = Arch == llvm::Triple::x86_64 ? "" : "/64";
const std::string Suffix = Is32Bits ? Suffix32 : Suffix64;
const std::string Multilib = Is32Bits ? "lib32" : "lib64";
OpenPOWER on IntegriCloud