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

Anton Smirnov dev at antonsmirnov.name
Sat Sep 28 23:39:53 PDT 2013


I've found both *tblgens in build folder, not in installed files folder.

Then i used the paths above for cross-compiling using cmake and received ld
error: that i have previously received:
"relocations in generic elf"  and finally "could not read symbols: file in
wrong format" for libLLVMSupport.a file:

Linking CXX executable ../../bin/llvm-tblgen
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../arm-linux-gnueabihf/bin/ld:
../../lib/libLLVMSupport.a(regcomp.c.o): Relocations in generic ELF (EM: 3)
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../arm-linux-gnueabihf/bin/ld:
../../lib/libLLVMSupport.a(regcomp.c.o): Relocations in generic ELF (EM: 3)
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../arm-linux-gnueabihf/bin/ld:
../../lib/libLLVMSupport.a(regcomp.c.o): Relocations in generic ELF (EM: 3)
../../lib/libLLVMSupport.a: could not read symbols: File in wrong format
clang-3.4: error: linker command failed with exit code 1 (use -v to see
invocation)
make[2]: *** [bin/llvm-tblgen] Error 1
make[1]: *** [utils/TableGen/CMakeFiles/llvm-tblgen.dir/all] Error 2
make: *** [all] Error 2

The files exists.
What should i do?


2013/9/29 Anton Smirnov <dev at antonsmirnov.name>

> Since tblgen need host compile to be done I've decided to do everything
> from scratch.
>
>
> mkdir & cd in new build folder
> cmake ../llvm
> -DCMAKE_INSTALL_PREFIX=/Users/asmirnov/llvm_cmake_host_installed
> -DCMAKE_BUILD_TYPE=Release
> make
> make install
>
> The first time i've used autotools to configure and make clang for host.
> Now i decided to use cmake.
>
> Now i don't have clang-tblgen executable for some reason (it was while
> using autotools but i refused to use it due to previous attempt ld errors):
> asmirnov at vmb:/Users/asmirnov/llvm_cmake_host_installed/bin$ find
> /Users/asmirnov/llvm_cmake_host_installed -name "*tblgen"
> /Users/asmirnov/llvm_cmake_host_installed/bin/llvm-tblgen
>
> Is it okay? Why while using cmake clang-tblgen was not done.
> There were no errors while cmake or make.
>
> Regards, Anton.
>
>
> 2013/9/29 Renato Golin <renato.golin at linaro.org>
>
>> On 28 September 2013 22:07, Anton Smirnov <dev at antonsmirnov.name> wrote:
>>
>>> I've specified paths for tblgens for host system. Is it wrong?
>>>
>>
>> No, that's correct, but it looks like your build directory is not clean.
>> CMake is not that smart, so complete removal and re-creation of the build
>> dir could fix that.
>>
>> --renato
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130929/b99fd78e/attachment.html>


More information about the cfe-dev mailing list