From 74aa8f114185e6a0f8efc612bd91f0bec6e3ebe2 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Thu, 6 Dec 2012 22:59:37 +0000 Subject: [PATCH] Add i686-linux-android for gcc toolchain detection. * Look for i686-linux-android under /lib/gcc. * This patch also slightly enhance the test suite for Android GCC toolchain detection. llvm-svn: 169557 --- clang/lib/Driver/ToolChains.cpp | 1 + .../basic_android_tree/arm-linux-androideabi/bin/as | 0 .../basic_android_tree/arm-linux-androideabi/bin/ld | 0 .../basic_android_tree/i686-linux-android/bin/ar | 0 .../basic_android_tree/i686-linux-android/bin/ld | 0 .../basic_android_tree/mipsel-linux-android/bin/as | 0 .../basic_android_tree/mipsel-linux-android/bin/ld | 0 clang/test/Driver/android.c | 21 +++++++++++++++++++++ clang/test/Driver/linux-ld.c | 8 ++++---- 9 files changed, 26 insertions(+), 4 deletions(-) create mode 100755 clang/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/as create mode 100755 clang/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/ld create mode 100755 clang/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ar create mode 100755 clang/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ld create mode 100755 clang/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/as create mode 100755 clang/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/ld create mode 100644 clang/test/Driver/android.c diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 179f0fd..5bfd714 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1094,6 +1094,7 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector( "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu", + "i686-linux-android", "i686-redhat-linux", "i586-redhat-linux", "i386-redhat-linux", diff --git a/clang/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/as b/clang/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/as new file mode 100755 index 0000000..e69de29 diff --git a/clang/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/ld b/clang/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/ld new file mode 100755 index 0000000..e69de29 diff --git a/clang/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ar b/clang/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ar new file mode 100755 index 0000000..e69de29 diff --git a/clang/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ld b/clang/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ld new file mode 100755 index 0000000..e69de29 diff --git a/clang/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/as b/clang/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/as new file mode 100755 index 0000000..e69de29 diff --git a/clang/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/ld b/clang/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/ld new file mode 100755 index 0000000..e69de29 diff --git a/clang/test/Driver/android.c b/clang/test/Driver/android.c new file mode 100644 index 0000000..cd61a19 --- /dev/null +++ b/clang/test/Driver/android.c @@ -0,0 +1,21 @@ +// Test Android Toolchain Detection + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o \ +// RUN: -target arm-linux-androideabi \ +// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ANDROID-ARM %s +// CHECK-ANDROID-ARM: "{{.*}}/Inputs/basic_android_tree/{{.*}}/arm-linux-androideabi/bin/as" +// CHECK-ANDROID-ARM: "{{.*}}/Inputs/basic_android_tree/{{.*}}/arm-linux-androideabi/bin/ld" + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o \ +// RUN: -target mipsel-linux-android \ +// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ANDROID-MIPS %s +// CHECK-ANDROID-MIPS: "{{.*}}/Inputs/basic_android_tree/{{.*}}/mipsel-linux-android/bin/as" +// CHECK-ANDROID-MIPS: "{{.*}}/Inputs/basic_android_tree/{{.*}}/mipsel-linux-android/bin/ld" + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o \ +// RUN: -target i686-linux-android \ +// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ANDROID-X86 %s +// CHECK-ANDROID-X86: "{{.*}}/Inputs/basic_android_tree/{{.*}}/i686-linux-android/bin/ld" diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c index 06be358..c0ea45d 100644 --- a/clang/test/Driver/linux-ld.c +++ b/clang/test/Driver/linux-ld.c @@ -412,7 +412,7 @@ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target i386-linux-android \ +// RUN: -target i686-linux-android \ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" @@ -439,7 +439,7 @@ // RUN: -shared \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target i386-linux-android \ +// RUN: -target i686-linux-android \ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: -shared \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s @@ -468,7 +468,7 @@ // RUN: -static \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target i386-linux-android \ +// RUN: -target i686-linux-android \ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: -static \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s @@ -496,7 +496,7 @@ // RUN: -pie \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target i386-linux-android \ +// RUN: -target i686-linux-android \ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: -pie \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s -- 2.7.4