<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 4, 2013 at 2:15 AM, Alexey Volkov <span dir="ltr"><<a href="mailto:avolkov.intel@gmail.com" target="_blank">avolkov.intel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
This patch improving x86 android target support.<br>
Look for x86_64-android-linux under <sysroot>/lib/gcc.<br>
i386-linux-android is renamed to i686-linux-android to align with Android project.<br>
Use /system/bin/linker64 as dynamic linker on x86_64.<br>
<br>
Alexey Volkov<br>
Intel Corporation<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D2325" target="_blank">http://llvm-reviews.chandlerc.com/D2325</a><br>
<br>
Files:<br>
lib/Driver/ToolChains.cpp<br>
lib/Driver/Tools.cpp<br>
test/Driver/clang-translation.c<br>
test/Driver/linux-ld.c<br>
<br>
Index: lib/Driver/ToolChains.cpp<br>
===================================================================<br>
--- lib/Driver/ToolChains.cpp<br>
+++ lib/Driver/ToolChains.cpp<br>
@@ -1118,14 +1118,15 @@<br>
static const char *const X86_64Triples[] = {<br>
"x86_64-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-pc-linux-gnu",<br>
"x86_64-redhat-linux6E", "x86_64-redhat-linux", "x86_64-suse-linux",<br>
- "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux"<br>
+ "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux",<br>
+ "x86_64-linux-android"<br>
};<br>
static const char *const X86LibDirs[] = { "/lib32", "/lib" };<br>
static const char *const X86Triples[] = {<br>
"i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu",<br>
"i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux",<br>
"i386-redhat-linux", "i586-suse-linux", "i486-slackware-linux",<br>
- "i686-montavista-linux"<br>
+ "i686-montavista-linux", "i686-linux-android"<br>
};<br>
<br>
static const char *const MIPSLibDirs[] = { "/lib" };<br>
Index: lib/Driver/Tools.cpp<br>
===================================================================<br>
--- lib/Driver/Tools.cpp<br>
+++ lib/Driver/Tools.cpp<br>
@@ -6278,9 +6278,12 @@<br>
<br>
static StringRef getLinuxDynamicLinker(const ArgList &Args,<br>
const toolchains::Linux &ToolChain) {<br>
- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::Android)<br>
- return "/system/bin/linker";<br>
- else if (ToolChain.getArch() == llvm::Triple::x86)<br>
+ if (ToolChain.getTriple().getEnvironment() == llvm::Triple::Android) {<br>
+ if (ToolChain.getArch() == llvm::Triple::x86_64)<br>
+ return "/system/bin/linker64";<br></blockquote><div><br></div><div>Does Android have a 64-bit MIPS or AArch64 target? Would this patch do the right thing for those targets or would you need to change this condition to checking the width of a pointer?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ else<br>
+ return "/system/bin/linker";<br>
+ } else if (ToolChain.getArch() == llvm::Triple::x86)<br>
return "/lib/ld-linux.so.2";<br>
else if (ToolChain.getArch() == llvm::Triple::aarch64)<br>
return "/lib/ld-linux-aarch64.so.1";<br>
Index: test/Driver/clang-translation.c<br>
===================================================================<br>
--- test/Driver/clang-translation.c<br>
+++ test/Driver/clang-translation.c<br>
@@ -206,8 +206,14 @@<br>
// AMD64-MINGW: "amd64--mingw32"<br>
// AMD64-MINGW: "-munwind-tables"<br>
<br>
-// RUN: %clang -target i386-linux-android -### -S %s 2>&1 \<br>
+// RUN: %clang -target i686-linux-android -### -S %s 2>&1 \<br>
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
// RUN: | FileCheck --check-prefix=ANDROID-X86 %s<br>
// ANDROID-X86: clang<br>
// ANDROID-X86: "-target-cpu" "core2"<br>
+<br>
+// RUN: %clang -target x86_64-linux-android -### -S %s 2>&1 \<br>
+// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
+// RUN: | FileCheck --check-prefix=ANDROID-X86_64 %s<br>
+// ANDROID-X86_64: clang<br>
+// ANDROID-X86_64: "-target-cpu" "core2"<br>
Index: test/Driver/linux-ld.c<br>
===================================================================<br>
--- test/Driver/linux-ld.c<br>
+++ test/Driver/linux-ld.c<br>
@@ -516,7 +516,11 @@<br>
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s<br>
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
-// RUN: --target=i386-linux-android \<br>
+// RUN: --target=i686-linux-android \<br>
+// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
+// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
+// RUN: --target=x86_64-linux-android \<br>
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s<br>
// CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"<br>
@@ -543,7 +547,12 @@<br>
// RUN: -shared \<br>
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s<br>
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
-// RUN: --target=i386-linux-android \<br>
+// RUN: --target=i686-linux-android \<br>
+// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
+// RUN: -shared \<br>
+// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
+// RUN: --target=x86_64-linux-android \<br>
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
// RUN: -shared \<br>
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s<br>
@@ -572,7 +581,12 @@<br>
// RUN: -static \<br>
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s<br>
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
-// RUN: --target=i386-linux-android \<br>
+// RUN: --target=i686-linux-android \<br>
+// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
+// RUN: -static \<br>
+// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
+// RUN: --target=x86-linux-android \<br>
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
// RUN: -static \<br>
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s<br>
@@ -600,7 +614,12 @@<br>
// RUN: -pie \<br>
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s<br>
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
-// RUN: --target=i386-linux-android \<br>
+// RUN: --target=i686-linux-android \<br>
+// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
+// RUN: -pie \<br>
+// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
+// RUN: --target=x86_64-linux-android \<br>
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \<br>
// RUN: -pie \<br>
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s<br>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div>