[cfe-commits] r151482 - in /cfe/trunk: lib/Driver/ test/Driver/ test/Driver/Inputs/debian_multiarch_tree/ test/Driver/Inputs/debian_multiarch_tree/lib/ test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/ test/Driver/Inputs/debian_multiarch_tree/lib/powerpc-linux-gnu/ test/Driver/Inputs/debian_multiarch_tree/lib/powerpc64-linux-gnu/ test/Driver/Inputs/debian_multiarch_tree/lib/x86_64-linux-gnu/ test/Driver/Inputs/debian_multiarch_tree/usr/ test/Driver/Inputs/debian_multiarch_tree/usr/include/ test/Driver/Input...
Chandler Carruth
chandlerc at gmail.com
Sun Feb 26 01:03:22 PST 2012
Author: chandlerc
Date: Sun Feb 26 03:03:21 2012
New Revision: 151482
URL: http://llvm.org/viewvc/llvm-project?rev=151482&view=rev
Log:
Add support for PPC and PPC64 multiarch toolchains on Debain.
Patch from Michel Dänzer, sent our way via Jeremy Huddleston who added
64-bit support. I just added one other place where powerpc64-linux-gnu
was missing (we only had powerpc64-unknown-linux-gnu).
I've also added a tree to test out the debian multiarch stuff. I don't
use debian regularly, so I'm not certain this is entirely accurate. If
anyone wants to check it against a debian system and fix any
inaccuracies, fire away. This way at least folks can see how this is
*supposed* to be tested.
It'd be particularly good to get the Debian MIPS toolchains tested in
this way.
Added:
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc64-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc64-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/x86_64-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/x86_64-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/backward/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/backward/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc64-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc64-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/x86_64-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/x86_64-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc64-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc64-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/x86_64-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/x86_64-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/i386-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/i386-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc64-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc64-linux-gnu/.keep
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/x86_64-linux-gnu/
cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/x86_64-linux-gnu/.keep
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/test/Driver/linux-ld.c
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=151482&r1=151481&r2=151482&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sun Feb 26 03:03:21 2012
@@ -1219,6 +1219,7 @@
};
static const char *const PPC64LibDirs[] = { "/lib64", "/lib" };
static const char *const PPC64Triples[] = {
+ "powerpc64-linux-gnu",
"powerpc64-unknown-linux-gnu",
"powerpc64-suse-linux",
"ppc64-redhat-linux"
@@ -1962,6 +1963,14 @@
if (llvm::sys::fs::exists(SysRoot + "/lib/mipsel-linux-gnu"))
return "mipsel-linux-gnu";
return TargetTriple.str();
+ case llvm::Triple::ppc:
+ if (llvm::sys::fs::exists(SysRoot + "/lib/powerpc-linux-gnu"))
+ return "powerpc-linux-gnu";
+ return TargetTriple.str();
+ case llvm::Triple::ppc64:
+ if (llvm::sys::fs::exists(SysRoot + "/lib/powerpc64-linux-gnu"))
+ return "powerpc64-linux-gnu";
+ return TargetTriple.str();
}
}
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc64-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/x86_64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/lib/x86_64-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c%2B%2B/4.5/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/backward/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c%2B%2B/4.5/backward/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c%2B%2B/4.5/i686-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c%2B%2B/4.5/powerpc-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c%2B%2B/4.5/powerpc64-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/x86_64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/c%2B%2B/4.5/x86_64-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc64-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/x86_64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/include/x86_64-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/i386-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/i386-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc64-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Added: cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/x86_64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_multiarch_tree/usr/lib/x86_64-linux-gnu/.keep?rev=151482&view=auto
==============================================================================
(empty)
Modified: cfe/trunk/test/Driver/linux-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=151482&r1=151481&r2=151482&view=diff
==============================================================================
--- cfe/trunk/test/Driver/linux-ld.c (original)
+++ cfe/trunk/test/Driver/linux-ld.c Sun Feb 26 03:03:21 2012
@@ -194,3 +194,54 @@
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s
// CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
+//
+// Thoroughly exercise the Debian multiarch environment.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target i686-linux-gnu \
+// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
+// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
+// CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5"
+// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../i386-linux-gnu"
+// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
+// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../.."
+// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/lib"
+// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib"
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-linux-gnu \
+// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
+// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
+// CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5"
+// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../x86_64-linux-gnu"
+// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu"
+// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../.."
+// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/lib"
+// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib"
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target powerpc-linux-gnu \
+// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
+// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
+// CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5"
+// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../powerpc-linux-gnu"
+// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/powerpc-linux-gnu"
+// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../.."
+// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/lib"
+// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib"
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target powerpc64-linux-gnu \
+// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
+// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
+// CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5"
+// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../powerpc64-linux-gnu"
+// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/powerpc64-linux-gnu"
+// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../.."
+// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib"
+// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib"
+//
More information about the cfe-commits
mailing list