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

Gordon Keiser gkeiser at arxan.com
Thu Nov 22 21:03:03 PST 2012


If /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../include/c++/4.6/ is the proper c++ include directory for your toolchain, I'm guessing bits/c++config.h will be located at
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../include/c++/4.6/arm-linux-gnueabi/bits/c++config.h ...  many of the arm cross toolchains (codesourcery for example) seem to be structured this way, although clang doesn't (or didn't as of 3.1) detect this layout.  Adding an include for that /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../include/c++/4.6/arm-linux-gnueabi/bits should fix it.

Cheers,
Gordon Keiser
Software Development Engineer
Arxan Technologies


From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Negar Mir
Sent: Wednesday, November 21, 2012 12:27 PM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] Is cross-compiling for ARM on x86 with llvm/Clang possible?

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121122/e6542f0d/attachment.html>


More information about the llvm-dev mailing list