Yin Ma via llvm-dev
2016-Jan-25 18:13 UTC
[llvm-dev] Why do we static link all llvm libraries in every executable?
Hi I found basically all llvm libraries are statically linked into each executable and LLVMgold.so, This make the clang/llvm package larger and larger with a lot of duplicated code. If I build debug version, the disk space required is even larger. Is there any particular reason to keep doing this way? 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. Yin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160125/8b67a8b8/attachment.html>
Joerg Sonnenberger via llvm-dev
2016-Jan-25 18:16 UTC
[llvm-dev] Why do we static link all llvm libraries in every executable?
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. Joerg
serge guelton via llvm-dev
2016-Jan-25 19:15 UTC
[llvm-dev] Why do we static link all llvm libraries in every executable?
On Mon, Jan 25, 2016 at 07:16:20PM +0100, 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.Namely BUILD_SHARED_LIBS=ON I find it very useful for dev builds!
Yury Gribov via llvm-dev
2016-Jan-26 08:44 UTC
[llvm-dev] Why do we static link all llvm libraries in every executable?
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.> Joerg > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >