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

NAKAMURA Takumi geek4civic at gmail.com
Tue Mar 4 15:12:51 PST 2014

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.

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

More information about the llvm-commits mailing list