[cfe-dev] How to compile Clang for ARM Linux on x86_64 Linux?

Renato Golin renato.golin at linaro.org
Sat Sep 28 12:06:43 PDT 2013


On 28 September 2013 19:29, Anton Smirnov <dev at antonsmirnov.name> wrote:

> asmirnov at vmb:~/llvm_cmake_build$ CC=clang
> asmirnov at vmb:~/llvm_cmake_build$ CXX=clang++
>

Oh, no, you need to set them on the CMake line itself. And you may want to
export the PATH (it's not necessary, you can use the full path on the
CC/CXX variables):

$ export PATH=/home/asmirnov/llvm_host_installed/bin:$PATH
$ CC=clang CXX=clang++ cmake ../llvm -DCMAKE_CROSSCOMPILING=True
-DCMAKE_INSTALL_PREFIX=/home/asmirnov/llvm_cmake_installed
-DLLVM_TABLEGEN=/home/asmirnov/llvm_host_build/Release+Asserts/bin/llvm-tblgen
-DCLANG_TABLEGEN=/home/asmirnov/llvm_host_build/Release+Asserts/bin/clang-tblgen
-DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf -DLLVM_TARGET_ARCH=ARM
-DLLVM_TARGETS_TO_BUILD=ARM -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/ -mfloat-abi=hard -ccc-gcc-name
arm-linux-gnueabihf-gcc'

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130928/55995d18/attachment.html>


More information about the cfe-dev mailing list