李阳 via llvm-dev
2016-Apr-28 14:07 UTC
[llvm-dev] problems with cross-compiling ARM from x86 PC
Hi everyone, Since I need to cross compile LLVM to ARM from x86 PC, I follow the guide [HowToCrossCompileLLVM.rst], and I still suffer from some problems. 1. About the Cmake option[-DLLVM_TABLEGEN], how do I replace the <path-to-host-bin>? Do I need to compile the LLVM for X86 on X86 PC first or install LLVM via apt-get on Ubuntu? 2. As mentioned about the hacks, I don't get any available ARM library resources, such as "libinfo", "libxml2" . So could anyone provide me with some links/ suggestions? 3. In my case, I download the llvm source from github, follow the guide in the docs directory, compiling clang/llvm for x86 on x86, and the llvm binaries can work. However when I compiling clang/llvm for ARM on x86, I specify the <path-to-host-bin> as the bin/llvm-tblgen in the directory I just compiled for x86. And the error shows "Host compiler appears to require libatomic, but cannot find it". So do you have suggestions for me? Thanks in advance! Best, Liyang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160428/aca5dd33/attachment.html>
Renato Golin via llvm-dev
2016-Apr-29 16:42 UTC
[llvm-dev] problems with cross-compiling ARM from x86 PC
On 28 April 2016 at 15:07, 李阳 via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Since I need to cross compile LLVM to ARM from x86 PC, I follow the guide > [HowToCrossCompileLLVM.rst], and I still suffer from some problems.Hi Liyang, I've added a task on my todo list to re-write those documents to a more modern setting. Now, specific to your questions...> 1. About the Cmake option[-DLLVM_TABLEGEN], how do I replace the > <path-to-host-bin>? Do I need to compile the LLVM for X86 on X86 PC first or > install LLVM via apt-get on Ubuntu?You can use whatever table-gen that works on your host. Though, you'll need both LLVM and Clang TableGen tools, and I don't think packages ship with both. If you have a built tree, that's the safer option.> 2. As mentioned about the hacks, I don't get any available ARM library > resources, such as "libinfo", "libxml2" . So could anyone provide me with > some links/ suggestions?I believe Ubuntu has something called multilib or multiarch, and that let's you install packages for alternative architectures. If memory serves me well, multilib just need something like "apt-get install libxml2-dev-arm" and multiarch needs you to add the arch, something like "dpkg --add-arch arm". Check the Ubuntu docs on multilib/arch to know more.> However when I compiling clang/llvm for ARM on x86, I specify the > <path-to-host-bin> as the bin/llvm-tblgen in the directory I just compiled > for x86. And the error shows "Host compiler appears to require libatomic, > but cannot find it".This is the same problem you have reported before. Have you used the correct triple (arm-linux-gnueabihf)? Have you used --sysroot like James asked? Have you made sure the tools Clang is picking are the ARM tools? If we don't know the answer to those questions, it's hard to know how to help you. cheers, --renato