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

Anton Smirnov dev at antonsmirnov.name
Sun Sep 29 03:53:12 PDT 2013


Can someone just compile clang for ARM and for x86 (not x86_64) linux
(Android to be more detailed), link statically and strip? i will be very
thankful.
It seems that a bunch of different unexpected problems..


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

> Not sure it is the reason - according to output clang and clang++
> (symlinked to clang) is identified:
>
> -- The C compiler identification is Clang 3.4.0
> -- The CXX compiler identification is Clang 3.4.0
> -- Check for working C compiler: /home/asmirnov/llvm_installed/bin/clang
> -- Check for working C compiler: /home/asmirnov/llvm_installed/bin/clang
> -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working CXX compiler:
> /home/asmirnov/llvm_installed/bin/clang++
> -- Check for working CXX compiler:
> /home/asmirnov/llvm_installed/bin/clang++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Looking for C++ include cxxabi.h
> -- Looking for C++ include cxxabi.h - found
>
>
> I have tried with -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER vars - the
> same error.
>
>
> 2013/9/29 Anton Korobeynikov <anton at korobeynikov.info>
>
>> > It looks like it didn't find clang++, but it did find clang, so maybe
>> you
>> > need the symlink from clang++ to clang there to make it work. It should
>> be
>> > there, no idea why it's not.
>> >
>> > arm-linux-gnueabihf-g++ will not be able to compile a simple test
>> program
>> > because CMake will try to execute it and it won't run (it's ARM).
>> cmake seems does not honor CC / CXX env. variables. The "hard way" to
>> specify C/C++ compiler there is via -DCMAKE_C_COMPILER=clang
>> -DCMAKE_CXX_COMPILER=clang++
>>
>> Also, I remember that some versions of cmake had bug, where it used
>> clang as C compiler and something else as C++ compiler. Something like
>> http://www.cmake.org/Bug/view.php?id=13505
>> --
>> With best regards, Anton Korobeynikov
>> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130929/8e84520d/attachment.html>


More information about the cfe-dev mailing list