[llvm-dev] LLVM questions

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 3 12:22:48 PDT 2019


On Tue, Sep 3, 2019 at 12:16 PM Fabiano Sidler via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi folks!
>
> I have a couple of questions:
> 1. Why is LLVM_LINK_LLVM_DYLIB not ON by default? Who needs a 2+GB
> bin/clang?
>

Because dynamic linking is slow - last I checked, at least for me/my setup,
the extra time spent in static linking was less than the time spent dynamic
linking when running all of LLVM & Clang's regression tests.

(that said, my clang binary is only 687MB - I guess yours is 2GB because
you're using debug info without split-dwarf (try LLVM_USE_SPLIT_DWARF if
it's suitable for your needs))


> 2. Why is BUILD_SHARED_LIBS output smaller than the one generated with
>    LLVM_LINK_LLVM_DYLIB? Shouldn't it be the other way since the latter
> saves
>    a lot of header information?
> 3. To make things easier for people who only want to compile llvm, clang
> and
>    libcxx*, a small snippet like the following on a prominent place would
> be
>    nice:
> === snip ===
> VERSION=8.0.1
> wget
> https://github.com/llvm/llvm-project/releases/download/llvmorg-${VERSION}/llvm-${VERSION}.src.tar.xz
> wget
> https://github.com/llvm/llvm-project/releases/download/llvmorg-${VERSION}/cfe-${VERSION}.src.tar.xz
> wget
> https://github.com/llvm/llvm-project/releases/download/llvmorg-${VERSION}/libcxx-${VERSION}.src.tar.xz
> wget
> https://github.com/llvm/llvm-project/releases/download/llvmorg-${VERSION}/libcxxabi-${VERSION}.src.tar.xz
> tar xf llvm-${VERSION}.src.tar.xz
> tar xf cfe-${VERSION}.src.tar.xz
> tar xf libcxx-${VERSION}.src.tar.xz
> tar xf libcxxabi-${VERSION}.src.tar.xz
> mv cfe-${VERSION}.src llvm-${VERSION}.src/projects
> mv libcxx-${VERSION}.src llvm-${VERSION}.src/projects
> mv libcxxabi-${VERSION}.src llvm-${VERSION}.src/projects
> mkdir build
> cd build
> cmake \
>   -DLLVM_ENABLE_FFI=ON \
>   -DCMAKE_BUILD_TYPE=Release \
>   -DLLVM_ENABLE_RTTI=ON \
>   -DLLVM_TARGETS_TO_BUILD="host" \
>   -DBUILD_SHARED_LIBS=ON \
>   ../llvm-${VERSION}.src
> cmake --build .
> cmake -DCMAKE_INSTALL_PREFIX=/some/where -P cmake_install.cmake
> === snap ===
>
> Greetings,
> Fabiano
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190903/5cf27d5c/attachment.html>


More information about the llvm-dev mailing list