[LLVMdev] Cross compile LLVM

Justin Holewinski justin.holewinski at gmail.com
Thu Dec 13 17:38:03 PST 2012

I'm assuming you mean "with" Android NDK "for" an ARM/MIPS/X86 Android
device.  Otherwise, there's no need to cross-compile.

That said, this is what I would expect the build to do.  You're
cross-compiling, so you want a version of LLVM built for a different
system.  Everything in tools/ will be built to be used on the target
system, not the host system.  If you want tools for the host system, you
can compile LLVM normally.  Tablegen will be built for the host system
because it is needed during the build process.  I'm not sure about clang,
it seems like a bug if you compile for Android/ARM and get a Linux/X86
version of clang.

On Thu, Dec 13, 2012 at 5:01 PM, Rami Jiossy <sramij at gmail.com> wrote:

> Hi;
> I am trying to cross compile LLVM for Android-NDK;
> I am using CMake as a build system; hence, i have defined
> CMAKE_SYSTEM_NAME variable so to turn on CMAKE_CROSSCOMPILING flag, being
> used by LLVM.
> As far as i understand from the LLVM structure; when cross compiling,
> executable are generated with two versions; one goes under the target build
> directory ${CMAKE_BINARY_DIR} and the other goes into
> ${CMAKE_BINARY_DIR}/native/....
> We i do that, i get all the tblgen + clang executable generated like that.
> however, the tools under TOOLS don't; and they aren't runnable on the
> host-build system.
> why is that? any ideas are appreciated.
> Thanks
> --
> Rami
>      Tel.     4-865-6245
>      Pele.    54-8159949
>      e-mail. sramij at gmail.com
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121213/0fa8a8b4/attachment.html>

More information about the llvm-dev mailing list