<div dir="ltr"><img src="cid:ii_infs1zq01_1544ca9a2a5d3be2" width="544" height="104"><br>​Hi all,<div><br></div><div>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. </div><div><br></div><div>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.</div><div><br></div><div>Sorry to finish reading, thanks. My command is as follows:</div><div><br></div><div>CC='clang' CXX='clang++' cmake -G Ninja ../llvm-source-code -DCMAKE_CROSSCOMPILING=True </div><div>-DCMAKE_INSTALL_PREFIX=./llvm </div><div>-DLLVM_TABLEGEN=/home/lab/workspace/llvm/build4x86/bin/llvm-tblgen </div><div>-DCLANG_TABLEGEN=/home/lab/workspace/llvm/build4x86/bin/clang-tblgen </div><div>-DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf </div><div>-DLLVM_TARGET_ARCH=ARM </div><div>-DLLVM_TARGETS_TO_BUILD=ARM </div><div>-DCMAKE_CXX_FLAGS='-target armv7a-linux-gnueabihf -mcpu=cortex-a9 -I/usr/arm-linux-gnueabihf/include/c++/4.7.3/arm-linux-gnueabihf/ -I/usr/arm-linux-gnueabihf/include/ -I/home/lab/workspace/llvm/llvm-source-code/lib4arm/ -I/home/lab/workspace/llvm/llvm-source-code/lib2ubuntu/ -I/usr/lib/gcc/x86_64-linux-gnu/4.8/libatomic.so -I/usr/lib/gcc/x86_64-linux-gnu/4.8/libatomic.so -L/usr/lib/gcc/x86_64-linux-gnu/4.8/libatomic.so -L/usr/lib/gcc/x86_64-linux-gnu/4.8/libatomic.a -mfloat-abi=hard -ccc-gcc-name arm-linux-gnueabihf-gcc' </div><div>-DLLVM_ENABLE_LIBCXX=ON </div><div>-DLLVM_ENABLE_PIC=False<br></div><div><br></div><div>The error is as follows:</div><div>1. Host compiler appears to require libatomic, but cannot find it.</div><div>2. Host Clang must be able to find libstdc++4.7 or newer!</div><div><br></div><div>Could anyone give me some suggestions? Thanks in advance!</div><div><br></div><div>Best,</div><div>Liyang</div></div>