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

李阳 via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 25 08:56:27 PDT 2016

Hi James,

1. I have tried with your suggestion, the command is as follows:

CC='clang' CXX='clang++' cmake -G Ninja ../llvm-source-code
-DCMAKE_CXX_FLAGS='-target armv7a-linux-gnueabihf -mcpu=cortex-a9
--sysroot=/usr/arm-linux-gnueabihf/ -mfloat-abi=hard -ccc-gcc-name

But it still produce error, like this:

CMake Error at
  The C++ compiler "/home/lab/workspace/llvm/build4x86/bin/clang++" is not
  able to compile a simple test program.

/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi

  Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om
  elf_k1om i386pep i386pe

  clang-3.9: error: linker command failed with exit code 1 (use -v to see

  ninja: build stopped: subcommand failed.

2. If I maually add all the libraries/headers, it don't produce the errors

So I think I still need to download some necessary libraries.

Thanks for your reply!


2016-04-25 23:42 GMT+08:00 James Molloy <james at jamesmolloy.co.uk>:

> You shouldn't need any. Did you attempt my suggestion ?
> On Mon, 25 Apr 2016 at 16:40, 李阳 <yanglee.cqu at gmail.com> wrote:
>> Hi James, renato,
>> So how do I download the missing ARM libraries on Ubuntu14.04? I cannot
>> find any available libraries.
>> Best,
>> Liyang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160425/05f4582a/attachment.html>

More information about the llvm-dev mailing list