[PATCH] [CMake] Introduce libLLVM.so as LLVM_ENABLE_SHARED

Tobias Grosser tobias at grosser.es
Tue Mar 4 15:15:47 PST 2014

On 03/05/2014 12:12 AM, NAKAMURA Takumi wrote:
> 2014-03-05 2:42 GMT+09:00 Tobias Grosser <tobias at grosser.es>:
>> On 03/04/2014 06:06 PM, NAKAMURA Takumi wrote:
>>> Hi chandlerc,
>>> Note, this includes; http://llvm-reviews.chandlerc.com/D2941
>> Why do you include this? The patch in general looks unnecessary big. Is
>> there a need to keep all this together? Some changes like the one above) are
>> really cleanups, that could be committed ahead of time. This would make the
>> actual patch review easier.
> Sorry for my laziness since I didn't eliminate D2941 stuff. I will
> work again later.
>>> **Why using OBJLIB?**
>>> - --whole-archive is available only for GNU ld. Rather, I chose linking
>>> whole OBJLIBs.
>>> - No need to create *.a(s). Archive files may be created in parallel.
>>> **Why introducing DEPENDS instead of add_dependencies?**
>>> - add_dependencies(target) works only for the target. Implicitly generated
>>> obj.LLVM*** are required to add deps to generated files.
>>> **Why llvm-tblgen and clang-tblgen are tweaked?**
>>> - They should be built out of LINK_COMPONENTS with -static.
>>> - I think -ffunction-sections would not make sense for the big libLLVM.so.
>> Out of interest, what is the motivation for introducing a libLLVM.so? I
>> currently use BUILD_SHARED_LIBS=ON to avoid long link times in my
>> incremental development builds. I assume this is not the motivation for
>> libLLVM.so? Would BUILD_SHARED_LIBS still work after this patch?
> Autoconf's --enable-shared provides the functionality and some people
> have wanted in cmake.
> http://llvm.org/bugs/show_bug.cgi?id=15493

That is motivation enough for me. Would be good to put this in the 
commit message.

> I am a fan of such "the big DLL".

You did not answer the last question, will BUILD_SHARED_LIBS still work 
as today? This functionality is something I would like to maintain, as 
it can reduce linking time a lot.


More information about the llvm-commits mailing list