[LLVMdev] Using thin archives when building llvm

NAKAMURA Takumi geek4civic at gmail.com
Wed Jul 15 21:14:00 PDT 2015


FYI, I override CMAKE_CXX_CREATE_STATIC_LIBRARY.

See,
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/8687/steps/CMake/logs/stdio

2015年7月16日(木) 12:37 Pete Cooper <peter_cooper at apple.com>:

> On Jul 15, 2015, at 6:00 PM, Rafael Espíndola <rafael.espindola at gmail.com>
> 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.
>
> By locally making thin archives the default I was able to build
> llvm+lld+clang with them. The total size of the .a files goes from
> 181,658,164 to 7,116,900 bytes.
>
> Nice!
>
>
> 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 ….
>
> I found an answer, but its not much better than having a hacked up version
> of llvm-ar:
>
> http://stackoverflow.com/questions/5659225/how-to-set-the-options-for-cmake-ar
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__stackoverflow.com_questions_5659225_how-2Dto-2Dset-2Dthe-2Doptions-2Dfor-2Dcmake-2Dar&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=Jpp1nE_QdPfy53TuYzax1tQ9vm54WtEfIxOzgPgQd20&s=tsgr0UMk83KCBHpabWCkl7li3BJKlRMW1wjGKpCoN7k&e=>
>
> Cheers,
> Pete
>
>
> Thanks,
> Rafael
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150716/4968087e/attachment.html>


More information about the llvm-dev mailing list