[cfe-dev] [llvm-dev] Why do we static link all llvm libraries in every executable?

Yury Gribov via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 27 00:54:36 PST 2016


On 01/27/2016 12:39 AM, Craig, Ben via cfe-dev wrote:
> Properly separating global / default symbols from internal / hidden
> symbols would take a substantial amount of effort.  To put the amount of
> effort in perspective, there are more than 700 LLVM headers that provide
> the interface between the LLVM static libraries.  There are more than
> 300 Clang headers to provide the interface between the Clang static
> libraries.
>
> I think the change could be done, and it would be valuable, but it isn't
> a quick change.  You would also get to deal with all the non-portable
> platform peculiarities.

A pity Prelink does not support this use-case (prelinking just a subset 
of loaded libraries).

> On 1/26/2016 3:32 PM, Yin Ma via cfe-dev wrote:
>>
>> Hi,
>>
>> Thank you for explaining and providing the option. I will give a try.
>>
>> 10x slower..on Linux? If we limit the number of global symbols
>> exposed, it will
>>
>> help the situation?
>>
>> Yin
>>
>> *From:*llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] *On Behalf Of
>> *David Blaikie via llvm-dev
>> *Sent:* Tuesday, January 26, 2016 7:46 AM
>> *To:* Yury Gribov
>> *Cc:* llvm-dev; Clang Dev
>> *Subject:* Re: [llvm-dev] [cfe-dev] Why do we static link all llvm
>> libraries in every executable?
>>
>> On Tue, Jan 26, 2016 at 12:44 AM, Yury Gribov via cfe-dev
>> <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>>
>>     On 01/25/2016 09:16 PM, Joerg Sonnenberger via llvm-dev wrote:
>>
>>         On Mon, Jan 25, 2016 at 10:13:35AM -0800, Yin Ma via llvm-dev
>>         wrote:
>>
>>             If we separate several shared libraries something like
>>             libclang.so, libllvm.so and let all executables and
>>             llvmgold.so just
>>             linked with .so. A lot of space could be saved and
>>             loading performance could be improved.
>>
>>
>>         There is a build option to do exactly that. It comes at a
>>         significant
>>         price for startup, e.g. clang will take 10x as long for
>>         building a small
>>         example.
>>
>>
>>     Is this to process runtime relocations or run constructors? I
>>     wonder if Prelink or ElfHack could help.
>>
>> Runtime relocations, I would imagine (global ctors would have to run
>> in either mode - so shouldn't represent a difference, I would think?)
>>
>>         Joerg
>>         _______________________________________________
>>         LLVM Developers mailing list
>>         llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
>>         http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>>
>>     _______________________________________________
>>     cfe-dev mailing list
>>     cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>>     http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list