[llvm-dev] Problem with the way BUILD_SHARED_LIBS=ON handled in llvm 3.8

ChrisBieneman via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 26 08:57:46 PST 2016


Yes, I'm aware of the change that caused this. It was when I stopped setting SOVERSION as a target property on all shared libraries. That change was deliberate in order to match functionality between CMake and the autoconf build.

In the autoconf build we didn't actually set the SOVERSION on libraries. Instead we include the version in the name of libLLVM, and we didn't version libLTO (except on Darwin).

I believe we are coming back to the point that BUILD_SHARED_LIBS=On should never be used when building a distribution, so the libraries shouldn't be versioned. The only reason to use libLTO is if your system linker is slow and you want to improve iteration times.

A clang built with BUILD_SHARED_LIBS=On will be significantly slower than one built against a single LLVM dynamic library, and in turn that is significantly slower than a clang built against static libraries. On Darwin process launch for a clang built against an LLVM dynamic library takes 2ms longer to launch than clang built against static libraries.

The fix here is not to make BUILD_SHARED_LIBS work the way it used to. The fix is to make LLVM_LINK_LLVM_DYLIB work with out-of-tree builds.

Also, as a note, I believe that reverting the change that caused this is a non-starter (others can feel free to disagree). That change fixed a blocking issue that prevented clients of the autoconf builds from moving to CMake.

-Chris

Sent from my iPad

> On Jan 26, 2016, at 8:15 AM, Ismail Donmez <ismail at i10z.com> wrote:
> 
> Hi,
> 
>> On Tue, Jan 19, 2016 at 8:09 PM, Chris Bieneman <beanz at apple.com> wrote:
>> I think the right solution here is to fix LLVM_BUILD_LLVM_DYLIB and LLVM_LINK_LLVM_DYLIB (which should work) rather than fixing BUILD_SHARED_LIBS which was never intended to work for this use case.
>> 
>> Either way, patches welcome.
> 
> This seems to be due to your commit http://reviews.llvm.org/D13841 ,
> the problem is I don't get properly versioned symlinks even after
> install. All I get is bare libLLVMFooBar.so files.


More information about the llvm-dev mailing list