[llvmlinux] cross-compiling llvm/clang for android

Anton Smirnov dev at antonsmirnov.name
Thu Sep 26 15:56:34 UTC 2013


Hi, Mark.

2013/9/26 Charlebois, Mark <mcharleb at quicinc.com>

>  Hi Anton,****
>
> ** **
>
> We do not currently build clang to run on anything but the host used to
> build it. We do however build the ARM, i686 and x86_64 backends for clang
> for code generation.
>

To be honest, i'm going to use clang only as cpp parser in order to provide
autocomplete and syntax highlighting in my android IDE. So i don't need
code generation (for ARM or any other arch) functional actually. Can i
compile libclang.so for ARM-Linux on my x86_64-darwin machine somehow? As
android is linux kernel + java libs it seems to be pretty possible.


> ****
>
> ** **
>
> I have not tried to build clang for ARM or clang for Android. I do not
> think the work done so far in the LLVMLinux project will help you.
>

Any help is highly appreciated.

Regards, Anton.


> ****
>
> ** **
>
> Regards,****
>
> ** **
>
> Mark****
>
> ** **
>
> *From:* llvmlinux-bounces at lists.linuxfoundation.org [mailto:
> llvmlinux-bounces at lists.linuxfoundation.org] *On Behalf Of *Anton Smirnov
> *Sent:* Wednesday, September 25, 2013 11:47 PM
> *To:* llvmlinux at lists.linuxfoundation.org
> *Subject:* [llvmlinux] cross-compiling llvm/clang for android****
>
> ** **
>
> First i will describe my problem in original llvm/clang and probably it's
> solved in llvm linux project.****
>
> ** **
>
> I'm trying to cross-compile clang to run on Android devices (both arm and
> x86).****
>
> I've read "getting started" <http://llvm.org/docs/GettingStarted.html> (including
> cross-compilation section) and all the websites about clang
> cross-compilation that i was able to find.****
>
> ** **
>
> So i'm pretty sure it's bug.****
>
> ** **
>
> i've followed all the steps to checkout the sources and started to compile
> it according to my aim:****
>
> ** **
>
> ../llvm/configure --prefix=/softdev/clang/arm --host=arm-linux-androideabi
> --with-float=hard --with-fpu=neon --enable-optimized --enable-targets=arm*
> ***
>
> ** **
>
> then i'm getting make error:****
>
> ** **
>
> ld: unknown option:
> --version-script=/Users/asmirnov/Documents/dev/src/llvm/autoconf/ExportMap.map
> ****
>
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)****
>
> make[2]: ***
> [/Users/asmirnov/Documents/dev/src/llvm_build/Release+Asserts/bin/FileCheck]
> Error 1****
>
> make[1]: *** [FileCheck/.makeall] Error 2****
>
> make: *** [all] Error 1****
>
> ** **
>
> the problem is that macosx ld does not support "--version-script"
> parameter.****
>
> this seems to relate to cross-compilation only as compilation for host
> system lasts much longer and i believe it's okay.****
>
> ** **
>
> After it i've found your project llvm linux.****
>
> ** **
>
> What can be done? Is there any ready solution or walk-around in llvm linux?
> ****
>
> Thanks in advance and regards, Anton.****
>
> ** **
>
> PS. It's for free project ArduinoDroid:
> https://play.google.com/store/apps/details?id=name.antonsmirnov.android.arduinodroid
> ****
>
> _______________________________________________
> LLVMLinux mailing list
> LLVMLinux at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/llvmlinux/attachments/20130926/8dc2e400/attachment-0001.html>


More information about the LLVMLinux mailing list