[cfe-dev] make target for clang

Jean-Daniel Dupas devlists at shadowlab.org
Wed Jul 11 07:37:23 PDT 2012


Le 11 juil. 2012 à 16:22, Thiago Farina <tfarina at chromium.org> a écrit :

> On Wed, Jul 11, 2012 at 11:18 AM, Jiangning Liu <liujiangning1 at gmail.com> wrote:
>> Thiago,
>> 
>> I think clang is naturally retarget-able to a lot of targets simultaneously. If you don't add build target, you would be able to get a bunch of targets build, which means you can use clang command line option "-target xxx" to generate code for different targets, but with the same clang binary!
>> 
>> You can also specify a particular target to build on command line. If you use cmake to build, for example, you can use '-DLLVM_TARGETS_TO_BUILD="ARM"' to build arm target. If you just use make, you can use target triple like "arm-pc-linux-gnueabi".
>> 
> Oh, sorry for not being clearer. :(
> 
> What I meant is when compiling clang from source.
> 
> I just want to compile clang, not the tests and the other tools (my
> system is slow unfortunately).
> 
> So instead of just saying:
> 
> $ make
> 
> I want to say:
> 
> $ make clang # or whatever that target to compile just clang is.


There is a clang-only target that may reduce the number of item build, but clang has a lot of dependencies, so I'm not sure it will reduce compile time significantly.

You can also disable features you don't need too at configuration time. And make sure you compile only the backend you need (usually --enable-targets=host ).

-- Jean-Daniel








More information about the cfe-dev mailing list