[PATCH] Improve x86 android support, add x86_64 android target
Alexey Volkov
avolkov.intel at gmail.com
Mon Dec 23 01:53:45 PST 2013
Ping
2013/12/13 Alexey Volkov <avolkov.intel at gmail.com>
> Ping
>
>
> 2013/12/4 Alexey Volkov <avolkov.intel at gmail.com>
>
>> Addressed David's comment regarding other Android 64-bit targets.
>>
>> http://llvm-reviews.chandlerc.com/D2325
>>
>> CHANGE SINCE LAST DIFF
>> http://llvm-reviews.chandlerc.com/D2325?vs=5893&id=5898#toc
>>
>> Files:
>> lib/Driver/ToolChains.cpp
>> lib/Driver/Tools.cpp
>> test/Driver/clang-translation.c
>> test/Driver/linux-ld.c
>>
>> Index: lib/Driver/ToolChains.cpp
>> ===================================================================
>> --- lib/Driver/ToolChains.cpp
>> +++ lib/Driver/ToolChains.cpp
>> @@ -1118,14 +1118,15 @@
>> static const char *const X86_64Triples[] = {
>> "x86_64-linux-gnu", "x86_64-unknown-linux-gnu",
>> "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-manbo-linux-gnu", "x86_64-linux-gnu",
>> "x86_64-slackware-linux",
>> + "x86_64-linux-android"
>> };
>> 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"
>> + "i686-montavista-linux", "i686-linux-android"
>> };
>>
>> static const char *const MIPSLibDirs[] = { "/lib" };
>> Index: lib/Driver/Tools.cpp
>> ===================================================================
>> --- lib/Driver/Tools.cpp
>> +++ lib/Driver/Tools.cpp
>> @@ -6278,9 +6278,12 @@
>>
>> static StringRef getLinuxDynamicLinker(const ArgList &Args,
>> const toolchains::Linux
>> &ToolChain) {
>> - if (ToolChain.getTriple().getEnvironment() == llvm::Triple::Android)
>> - return "/system/bin/linker";
>> - else if (ToolChain.getArch() == llvm::Triple::x86)
>> + if (ToolChain.getTriple().getEnvironment() == llvm::Triple::Android) {
>> + if (ToolChain.getTriple().isArch64Bit())
>> + return "/system/bin/linker64";
>> + else
>> + return "/system/bin/linker";
>> + } else if (ToolChain.getArch() == llvm::Triple::x86)
>> return "/lib/ld-linux.so.2";
>> else if (ToolChain.getArch() == llvm::Triple::aarch64)
>> return "/lib/ld-linux-aarch64.so.1";
>> Index: test/Driver/clang-translation.c
>> ===================================================================
>> --- test/Driver/clang-translation.c
>> +++ test/Driver/clang-translation.c
>> @@ -206,8 +206,14 @@
>> // AMD64-MINGW: "amd64--mingw32"
>> // AMD64-MINGW: "-munwind-tables"
>>
>> -// RUN: %clang -target i386-linux-android -### -S %s 2>&1 \
>> +// RUN: %clang -target i686-linux-android -### -S %s 2>&1 \
>> // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
>> // RUN: | FileCheck --check-prefix=ANDROID-X86 %s
>> // ANDROID-X86: clang
>> // ANDROID-X86: "-target-cpu" "core2"
>> +
>> +// RUN: %clang -target x86_64-linux-android -### -S %s 2>&1 \
>> +// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
>> +// RUN: | FileCheck --check-prefix=ANDROID-X86_64 %s
>> +// ANDROID-X86_64: clang
>> +// ANDROID-X86_64: "-target-cpu" "core2"
>> Index: test/Driver/linux-ld.c
>> ===================================================================
>> --- test/Driver/linux-ld.c
>> +++ test/Driver/linux-ld.c
>> @@ -516,7 +516,11 @@
>> // 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
>> +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
>> +// RUN: --target=x86_64-linux-android \
>> // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
>> // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
>> // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
>> @@ -543,7 +547,12 @@
>> // 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
>> +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
>> +// RUN: --target=x86_64-linux-android \
>> // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
>> // RUN: -shared \
>> // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
>> @@ -572,7 +581,12 @@
>> // 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
>> +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
>> +// RUN: --target=x86-linux-android \
>> // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
>> // RUN: -static \
>> // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
>> @@ -600,7 +614,12 @@
>> // 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
>> +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
>> +// RUN: --target=x86_64-linux-android \
>> // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
>> // RUN: -pie \
>> // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
>>
>
>
>
> --
> Alexey Volkov
> Intel Corporation
>
--
Alexey Volkov
Intel Corporation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131223/5b6cb635/attachment.html>
More information about the cfe-commits
mailing list