[LLVMdev] Using thin archives when building llvm

Pete Cooper peter_cooper at apple.com
Fri Jul 17 09:54:28 PDT 2015


> On Jul 17, 2015, at 7:49 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> On 17 July 2015 at 07:19, Brad King <brad.king at kitware.com> wrote:
>> On 07/15/2015 09:00 PM, Rafael Espíndola wrote:
>>> I have just committed support to llvm-ar for creating thin archives.
>>> The idea of thin archives is that they contain just the symbol table
>>> and the path to find the original .o files.
>> 
>> Neat!  Is this expected to be used only for non-installed archives?
> 
> Yes, the idea is to speed up a regular development build.
> 
>>> Is there any way to do that with cmake without having to have a hacked
>>> llvm-ar? All that is needed is for cmake to run
>>> 
>>> .../llvm-ar cqT foo.a ....
>>> 
>>> instead of
>>> 
>>> .../llvm-ar cq foo.a ....
>> 
>> CMake has undocumented variables set by the Modules/Platform/*
>> files to specify the rules for creating archives.  These are:
>> 
>> CMAKE_<LANG>_ARCHIVE_{CREATE,APPEND,FINISH}
> 
> I went with this one on my run-cmake script, thanks.
FWIW, i’d more than welcome a patch to get this in to cmake.  

Chris added a flag (LLVM_OPTIMIZED_TBLGEN) to build an optimized tblgen and use that in the regular build.  I’d be happy to see a similar flag used to have that step build an llvm-ar used by the rest of compilation to use thin archives.  At least until we start shipping this.

I’m happy to propose a patch or help test one if you have one in future.

Cheers,
Pete
> 
> Cheers,
> Rafael
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list