[llvm-dev] bug: cross-compile Clang/LLVM for ARM using Clang/LLVM

李阳 via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 25 02:39:36 PDT 2016

​Hi all,

I'm new to LLVM project and now I need to cross-compile Clang/LLVM for ARM.
My host is Ubuntu 14.04 and I could compile Clang/LLVM for X86, however
when I cross-compile Clang/LLVM for ARM, I come across a few problems.

My build structure is in the picture. [llvm-source-code] is from github
llvm-mirror; [build4x86] is that I follow the guide  [Clang Getting
Started] and build clang/llvm to produce it; [build4arm] is that I try to
cross-compile clan/llvm for arm on x86 PC, the problem exist here.

Sorry to finish reading, thanks. My command is as follows:

CC='clang' CXX='clang++' cmake -G Ninja ../llvm-source-code
-DCMAKE_CXX_FLAGS='-target armv7a-linux-gnueabihf -mcpu=cortex-a9
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/libatomic.a -mfloat-abi=hard
-ccc-gcc-name arm-linux-gnueabihf-gcc'

The error is as follows:
1. Host compiler appears to require libatomic, but cannot find it.
2. Host Clang must be able to find libstdc++4.7 or newer!

Could anyone give me some suggestions? Thanks in advance!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160425/192555b8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2016-04-25 17:03:03.png
Type: image/png
Size: 17474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160425/192555b8/attachment-0001.png>

More information about the llvm-dev mailing list