<div dir="ltr">Hi renato,<div><br></div><div>1. The command above is followed by the guide[ HowToCrossCompileLLVM.rst ] and I specify some path(ex. <path-to-host-bin>).</div><div><br></div><div>2. The including x86_64 libraries is added because of  some missing libraries(ex. "error:  Host compiler appears to require libatomic, but cannot find it"). As I have found that the bugs needed to dealt with is some ARM-dependent libraries, I cannot download them on Ubuntu14, could you share them or some available links?</div><div><br></div><div>Thanks very much!</div><div><br></div><div>Best,</div><div>Liyang</div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-25 18:33 GMT+08:00 Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><div class="gmail_extra"><div class="gmail_quote">On 25 April 2016 at 10:39, 李阳 via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><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></blockquote><div></div></div><br></div></span><div class="gmail_extra">Hi Liyang,</div><div class="gmail_extra"><br></div><div class="gmail_extra">You have "LLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf"  and "CMAKE_CXX_FLAGS='-target armv7a-linux-gnueabihf" which are different, and may confuse Clang when finding tools and libraries. Use whatever is the ARM triple in your system (looks like it's "arm-linux-gnueabihf") and make both target triple and "-target" to be that exact same string.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Also, you're including x86_64 libraries (ex. -L/usr/lib/gcc/x86_64-linux-gnu/4.8/libatomic.so) to an ARM compilation job, that won't work. You have to find the ARM version (maybe /usr/lib/gcc/arm-linux-gnueabihf/ ?).</div><div class="gmail_extra"><br></div><div class="gmail_extra">Finally, the include paths with -I are only necessary if Clang cannot find it. The first three should be ok, but using -I on a DSO object (libatomic.so) makes no sense.</div><div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">--renato</div></div>
</blockquote></div><br></div></div>