forked from OSchip/llvm-project
Revert "[Driver] Android triples are not aliases for other triples."
Revering while I diagnose the failures. This reverts commit 82dc3bf2157da280420f80e654292cb05e0dc5f7. llvm-svn: 330780
This commit is contained in:
parent
891c8fb753
commit
07b0059083
|
@ -1816,20 +1816,22 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|||
// lifetime or initialization issues.
|
||||
static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
|
||||
static const char *const AArch64Triples[] = {
|
||||
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
|
||||
"aarch64-suse-linux"};
|
||||
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-linux-android",
|
||||
"aarch64-redhat-linux", "aarch64-suse-linux"};
|
||||
static const char *const AArch64beLibDirs[] = {"/lib"};
|
||||
static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
|
||||
"aarch64_be-linux-gnu"};
|
||||
|
||||
static const char *const ARMLibDirs[] = {"/lib"};
|
||||
static const char *const ARMTriples[] = {"arm-linux-gnueabi"};
|
||||
static const char *const ARMTriples[] = {"arm-linux-gnueabi",
|
||||
"arm-linux-androideabi"};
|
||||
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
|
||||
"armv7hl-redhat-linux-gnueabi",
|
||||
"armv6hl-suse-linux-gnueabi",
|
||||
"armv7hl-suse-linux-gnueabi"};
|
||||
static const char *const ARMebLibDirs[] = {"/lib"};
|
||||
static const char *const ARMebTriples[] = {"armeb-linux-gnueabi"};
|
||||
static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
|
||||
"armeb-linux-androideabi"};
|
||||
static const char *const ARMebHFTriples[] = {
|
||||
"armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi"};
|
||||
|
||||
|
@ -1839,14 +1841,16 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|||
"x86_64-pc-linux-gnu", "x86_64-redhat-linux6E",
|
||||
"x86_64-redhat-linux", "x86_64-suse-linux",
|
||||
"x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
|
||||
"x86_64-slackware-linux", "x86_64-unknown-linux"};
|
||||
"x86_64-slackware-linux", "x86_64-linux-android",
|
||||
"x86_64-unknown-linux"};
|
||||
static const char *const X32LibDirs[] = {"/libx32"};
|
||||
static const char *const X86LibDirs[] = {"/lib32", "/lib"};
|
||||
static const char *const X86Triples[] = {
|
||||
"i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu",
|
||||
"i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux",
|
||||
"i586-redhat-linux", "i386-redhat-linux", "i586-suse-linux",
|
||||
"i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu"};
|
||||
"i486-slackware-linux", "i686-montavista-linux", "i686-linux-android",
|
||||
"i586-linux-gnu"};
|
||||
|
||||
static const char *const MIPSLibDirs[] = {"/lib"};
|
||||
static const char *const MIPSTriples[] = {"mips-linux-gnu", "mips-mti-linux",
|
||||
|
@ -1865,6 +1869,13 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|||
"mips64el-linux-gnu", "mips-mti-linux-gnu", "mips-img-linux-gnu",
|
||||
"mips64el-linux-gnuabi64"};
|
||||
|
||||
static const char *const MIPSELAndroidLibDirs[] = {"/lib", "/libr2",
|
||||
"/libr6"};
|
||||
static const char *const MIPSELAndroidTriples[] = {"mipsel-linux-android"};
|
||||
static const char *const MIPS64ELAndroidLibDirs[] = {"/lib64", "/lib",
|
||||
"/libr2", "/libr6"};
|
||||
static const char *const MIPS64ELAndroidTriples[] = {
|
||||
"mips64el-linux-android"};
|
||||
|
||||
static const char *const PPCLibDirs[] = {"/lib32", "/lib"};
|
||||
static const char *const PPCTriples[] = {
|
||||
|
@ -1941,66 +1952,6 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|||
return;
|
||||
}
|
||||
|
||||
// Android targets should not use GNU/Linux tools or libraries.
|
||||
if (TargetTriple.isAndroid()) {
|
||||
static const char *const AArch64AndroidTriples[] = {
|
||||
"aarch64-linux-android"};
|
||||
static const char *const ARMAndroidTriples[] = {"arm-linux-androideabi"};
|
||||
static const char *const MIPSELAndroidTriples[] = {"mipsel-linux-android"};
|
||||
static const char *const MIPS64ELAndroidTriples[] = {
|
||||
"mips64el-linux-android"};
|
||||
static const char *const X86AndroidTriples[] = {"i686-linux-android"};
|
||||
static const char *const X86_64AndroidTriples[] = {"x86_64-linux-android"};
|
||||
|
||||
switch (TargetTriple.getArch()) {
|
||||
case llvm::Triple::aarch64:
|
||||
LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
|
||||
TripleAliases.append(begin(AArch64AndroidTriples),
|
||||
end(AArch64AndroidTriples));
|
||||
break;
|
||||
case llvm::Triple::arm:
|
||||
case llvm::Triple::thumb:
|
||||
LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
|
||||
TripleAliases.append(begin(ARMAndroidTriples), end(ARMAndroidTriples));
|
||||
break;
|
||||
case llvm::Triple::mipsel:
|
||||
LibDirs.append(begin(MIPSELLibDirs), end(MIPSELLibDirs));
|
||||
TripleAliases.append(begin(MIPSELAndroidTriples),
|
||||
end(MIPSELAndroidTriples));
|
||||
BiarchLibDirs.append(begin(MIPS64ELLibDirs), end(MIPS64ELLibDirs));
|
||||
BiarchTripleAliases.append(begin(MIPS64ELAndroidTriples),
|
||||
end(MIPS64ELAndroidTriples));
|
||||
break;
|
||||
case llvm::Triple::mips64el:
|
||||
LibDirs.append(begin(MIPS64ELLibDirs), end(MIPS64ELLibDirs));
|
||||
TripleAliases.append(begin(MIPS64ELAndroidTriples),
|
||||
end(MIPS64ELAndroidTriples));
|
||||
BiarchLibDirs.append(begin(MIPSELLibDirs), end(MIPSELLibDirs));
|
||||
BiarchTripleAliases.append(begin(MIPSELAndroidTriples),
|
||||
end(MIPSELAndroidTriples));
|
||||
break;
|
||||
case llvm::Triple::x86_64:
|
||||
LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
|
||||
TripleAliases.append(begin(X86_64AndroidTriples),
|
||||
end(X86_64AndroidTriples));
|
||||
BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
|
||||
BiarchTripleAliases.append(begin(X86AndroidTriples),
|
||||
end(X86AndroidTriples));
|
||||
break;
|
||||
case llvm::Triple::x86:
|
||||
LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
|
||||
TripleAliases.append(begin(X86AndroidTriples), end(X86AndroidTriples));
|
||||
BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
|
||||
BiarchTripleAliases.append(begin(X86_64AndroidTriples),
|
||||
end(X86_64AndroidTriples));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
switch (TargetTriple.getArch()) {
|
||||
case llvm::Triple::aarch64:
|
||||
LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
|
||||
|
@ -2062,11 +2013,22 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|||
BiarchTripleAliases.append(begin(MIPS64Triples), end(MIPS64Triples));
|
||||
break;
|
||||
case llvm::Triple::mipsel:
|
||||
LibDirs.append(begin(MIPSELLibDirs), end(MIPSELLibDirs));
|
||||
TripleAliases.append(begin(MIPSELTriples), end(MIPSELTriples));
|
||||
TripleAliases.append(begin(MIPSTriples), end(MIPSTriples));
|
||||
BiarchLibDirs.append(begin(MIPS64ELLibDirs), end(MIPS64ELLibDirs));
|
||||
BiarchTripleAliases.append(begin(MIPS64ELTriples), end(MIPS64ELTriples));
|
||||
if (TargetTriple.isAndroid()) {
|
||||
LibDirs.append(begin(MIPSELAndroidLibDirs), end(MIPSELAndroidLibDirs));
|
||||
TripleAliases.append(begin(MIPSELAndroidTriples),
|
||||
end(MIPSELAndroidTriples));
|
||||
BiarchLibDirs.append(begin(MIPS64ELAndroidLibDirs),
|
||||
end(MIPS64ELAndroidLibDirs));
|
||||
BiarchTripleAliases.append(begin(MIPS64ELAndroidTriples),
|
||||
end(MIPS64ELAndroidTriples));
|
||||
|
||||
} else {
|
||||
LibDirs.append(begin(MIPSELLibDirs), end(MIPSELLibDirs));
|
||||
TripleAliases.append(begin(MIPSELTriples), end(MIPSELTriples));
|
||||
TripleAliases.append(begin(MIPSTriples), end(MIPSTriples));
|
||||
BiarchLibDirs.append(begin(MIPS64ELLibDirs), end(MIPS64ELLibDirs));
|
||||
BiarchTripleAliases.append(begin(MIPS64ELTriples), end(MIPS64ELTriples));
|
||||
}
|
||||
break;
|
||||
case llvm::Triple::mips64:
|
||||
LibDirs.append(begin(MIPS64LibDirs), end(MIPS64LibDirs));
|
||||
|
@ -2075,11 +2037,23 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|||
BiarchTripleAliases.append(begin(MIPSTriples), end(MIPSTriples));
|
||||
break;
|
||||
case llvm::Triple::mips64el:
|
||||
LibDirs.append(begin(MIPS64ELLibDirs), end(MIPS64ELLibDirs));
|
||||
TripleAliases.append(begin(MIPS64ELTriples), end(MIPS64ELTriples));
|
||||
BiarchLibDirs.append(begin(MIPSELLibDirs), end(MIPSELLibDirs));
|
||||
BiarchTripleAliases.append(begin(MIPSELTriples), end(MIPSELTriples));
|
||||
BiarchTripleAliases.append(begin(MIPSTriples), end(MIPSTriples));
|
||||
if (TargetTriple.isAndroid()) {
|
||||
LibDirs.append(begin(MIPS64ELAndroidLibDirs),
|
||||
end(MIPS64ELAndroidLibDirs));
|
||||
TripleAliases.append(begin(MIPS64ELAndroidTriples),
|
||||
end(MIPS64ELAndroidTriples));
|
||||
BiarchLibDirs.append(begin(MIPSELAndroidLibDirs),
|
||||
end(MIPSELAndroidLibDirs));
|
||||
BiarchTripleAliases.append(begin(MIPSELAndroidTriples),
|
||||
end(MIPSELAndroidTriples));
|
||||
|
||||
} else {
|
||||
LibDirs.append(begin(MIPS64ELLibDirs), end(MIPS64ELLibDirs));
|
||||
TripleAliases.append(begin(MIPS64ELTriples), end(MIPS64ELTriples));
|
||||
BiarchLibDirs.append(begin(MIPSELLibDirs), end(MIPSELLibDirs));
|
||||
BiarchTripleAliases.append(begin(MIPSELTriples), end(MIPSELTriples));
|
||||
BiarchTripleAliases.append(begin(MIPSTriples), end(MIPSTriples));
|
||||
}
|
||||
break;
|
||||
case llvm::Triple::ppc:
|
||||
LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
|
||||
|
|
|
@ -302,38 +302,3 @@
|
|||
// CHECK-X86_64: "-L{{.*}}/sysroot/usr/lib/x86_64-linux-android/21"
|
||||
// CHECK-X86_64: "-L{{.*}}/sysroot/usr/lib/x86_64-linux-android"
|
||||
// CHECK-X86_64: "-L{{.*}}/lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/lib"
|
||||
|
||||
// We need two sets of tests to verify that we both don't find non-Android
|
||||
// toolchains installations and that we *do* find Android toolchains. We can't
|
||||
// do both at the same time in this environment because we need to pass
|
||||
// --sysroot to find the toolchains which would override searching in /usr. In a
|
||||
// production environment --sysroot is not used and the toolchains are instead
|
||||
// found relative to the clang binary, so both would be considered.
|
||||
|
||||
// RUN: %clang -v --target=i686-linux-android \
|
||||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-I686-GCC-NOSYS %s
|
||||
//
|
||||
// CHECK-I686-GCC-NOSYS-NOT: Found candidate GCC installation: /usr{{.*}}
|
||||
//
|
||||
// RUN: %clang -v --target=i686-linux-android \
|
||||
// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree \
|
||||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-I686-GCC %s
|
||||
//
|
||||
// CHECK-I686-GCC-NOT: Found candidate GCC installation: /usr{{.*}}
|
||||
// CHECK-I686-GCC: Found candidate GCC installation: {{.*}}i686-linux-android/4.9
|
||||
// CHECK-I686-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android/4.9
|
||||
// CHECK-I686-GCC-NEXT: Selected GCC installation: {{.*}}i686-linux-android/4.9
|
||||
|
||||
// RUN: %clang -v --target=x86_64-linux-android \
|
||||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-X86_64-GCC-NOSYS %s
|
||||
//
|
||||
// CHECK-X86_64-GCC-NOSYS-NOT: Found candidate GCC installation: /usr{{.*}}
|
||||
|
||||
// RUN: %clang -v --target=x86_64-linux-android \
|
||||
// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree \
|
||||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-X86_64-GCC %s
|
||||
//
|
||||
// CHECK-X86_64-GCC-NOT: Found candidate GCC installation: /usr{{.*}}
|
||||
// CHECK-X86_64-GCC: Found candidate GCC installation: {{.*}}i686-linux-android/4.9
|
||||
// CHECK-X86_64-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android/4.9
|
||||
// CHECK-X86_64-GCC-NEXT: Selected GCC installation: {{.*}}x86_64-linux-android/4.9
|
||||
|
|
Loading…
Reference in New Issue