[LLVMdev] Is cross-compiling for ARM on x86 with llvm/Clang possible?

Journeyer J. Joh oosaprogrammer at gmail.com
Wed Nov 21 16:26:37 PST 2012


Hello Negar Mir,

It's good that my experience help someone.

For me, this kind of errors require to put '-v' option in the build
command line so that the the exact build command can be exposed.

I compiled with the options below.
-ccc-host-triple $(CCC_HOST_TRIPLE_ARM) \
--sysroot=$(SYSROOT_ARM) \
-gcc-toolchain $(GCC_TOOLCHAIN)

And this options below needed to run compiled binary on the target.
-Wl,-dynamic-linker,/lib/ld-linux.so.3 (the version must be matched to
the one in the target)

But I haven't tried like you - mix .bc file with .c, .cpp to build a
final output.

I recommend you check with '-v' option.

Good luck!
Journeyer


2012/11/22 Negar Mir <nmiralaei at gmail.com>:
> Hi Journeyer J. Joh,
>
> Thank you so much for the solution. It was very helpful. Now, I'm wondering
> if you have tested compiling a whole project (with several .c/.cpp files)
> and achieve one binary file. Previously (on X86), I built .bc files
> separately and then I used llvm-link to get one .bc file and produce one
> binary file for the whole project. But, this time I encountered some errors
> like the following, and it seems that it cannot link to the appropriate ARM
> libraries.
>
> In file included from ../../../../LLVM/project/file1.cpp:8:
> /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../include/c++/4.6/iostream:38:10:
> fatal error:
>       'bits/c++config.h' file not found
> #include <bits/c++config.h>
>          ^
>
> Thanks
> Negar
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
----------------------------------------
Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l  d o t  c o m
----------------------------------------



More information about the llvm-dev mailing list