forked from OSchip/llvm-project
A follow-up to r151482 which added support for powerpc and powerpc64
Debian multiarch libraries, this should in theory add support for those platform's header search rules. I don't have a system to check this with, so review appreciated. I've added the corresponding tests referring to the debian multiarch tree. We are starting to have a relatively completely tested Linux platform for header search and library search, with several interesting peculiarities. We should point people at the debian_multiarch_tree when suggesting new tests. Folks with Debian systems that can check this for correctness, it would be much appreciated. The missing chunks I know of are testing bi-arch peudo-cross-compiling toolchains betwen 32-bit and 64-bit variants of platforms, and the MIPS and ARM Debian toolchains. llvm-svn: 151484
This commit is contained in:
parent
921bd20ddd
commit
2e9d731761
|
@ -2180,6 +2180,12 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
|
|||
const StringRef MIPSELMultiarchIncludeDirs[] = {
|
||||
"/usr/include/mipsel-linux-gnu"
|
||||
};
|
||||
const StringRef PPCMultiarchIncludeDirs[] = {
|
||||
"/usr/include/powerpc-linux-gnu"
|
||||
};
|
||||
const StringRef PPC64MultiarchIncludeDirs[] = {
|
||||
"/usr/include/powerpc64-linux-gnu"
|
||||
};
|
||||
ArrayRef<StringRef> MultiarchIncludeDirs;
|
||||
if (getTriple().getArch() == llvm::Triple::x86_64) {
|
||||
MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
|
||||
|
@ -2191,6 +2197,10 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
|
|||
MultiarchIncludeDirs = MIPSMultiarchIncludeDirs;
|
||||
} else if (getTriple().getArch() == llvm::Triple::mipsel) {
|
||||
MultiarchIncludeDirs = MIPSELMultiarchIncludeDirs;
|
||||
} else if (getTriple().getArch() == llvm::Triple::ppc) {
|
||||
MultiarchIncludeDirs = PPCMultiarchIncludeDirs;
|
||||
} else if (getTriple().getArch() == llvm::Triple::ppc64) {
|
||||
MultiarchIncludeDirs = PPC64MultiarchIncludeDirs;
|
||||
}
|
||||
for (ArrayRef<StringRef>::iterator I = MultiarchIncludeDirs.begin(),
|
||||
E = MultiarchIncludeDirs.end();
|
||||
|
|
|
@ -15,3 +15,61 @@
|
|||
// CHECK-UBUNTU-11-04: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
|
||||
// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
|
||||
// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
||||
//
|
||||
// Thoroughly exercise the Debian multiarch environment.
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 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: "{{.*}}clang{{(.exe)?}}" "-cc1"
|
||||
// CHECK-DEBIAN-X86: "-isysroot" "[[SYSROOT:[^"]+]]"
|
||||
// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5"
|
||||
// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/i686-linux-gnu"
|
||||
// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/backward"
|
||||
// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
||||
// CHECK-DEBIAN-X86: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
|
||||
// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-linux-gnu"
|
||||
// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/include"
|
||||
// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 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: "{{.*}}clang{{(.exe)?}}" "-cc1"
|
||||
// CHECK-DEBIAN-X86-64: "-isysroot" "[[SYSROOT:[^"]+]]"
|
||||
// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5"
|
||||
// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/x86_64-linux-gnu"
|
||||
// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/backward"
|
||||
// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
||||
// CHECK-DEBIAN-X86-64: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
|
||||
// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu"
|
||||
// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/include"
|
||||
// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 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: "{{.*}}clang{{(.exe)?}}" "-cc1"
|
||||
// CHECK-DEBIAN-PPC: "-isysroot" "[[SYSROOT:[^"]+]]"
|
||||
// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5"
|
||||
// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/powerpc-linux-gnu"
|
||||
// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/backward"
|
||||
// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
||||
// CHECK-DEBIAN-PPC: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
|
||||
// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc-linux-gnu"
|
||||
// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/include"
|
||||
// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 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: "{{.*}}clang{{(.exe)?}}" "-cc1"
|
||||
// CHECK-DEBIAN-PPC64: "-isysroot" "[[SYSROOT:[^"]+]]"
|
||||
// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5"
|
||||
// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/powerpc64-linux-gnu"
|
||||
// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/backward"
|
||||
// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
||||
// CHECK-DEBIAN-PPC64: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
|
||||
// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc64-linux-gnu"
|
||||
// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/include"
|
||||
// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
||||
|
|
Loading…
Reference in New Issue