[llvm-dev] Statically linking against libc++
Carsten Mattner via llvm-dev
llvm-dev at lists.llvm.org
Sun Apr 9 09:05:43 PDT 2017
While considering statically linking against libc++ (and
other runtime libraries from LLVM), I rebuilt LLVM 4.0
There are still some .so's in llvm/lib, and only one
of them seems to exist exclusively as a DSO (libLTO).
There's also livLLVMLTO.a, but I doubt LTO is used
after linking a binary so this just looks odd to an
uninformed LLVM outside and not insufficient or anything.
My question is two-fold:
1. when building a C++ program with clang, maybe making use
of clang-musl to avoid glibc as well, how do I statically
link libc++ and get a C++ program that runs on any Linux
kernel, allowing easy distribution of a single binary?
2. should the following .so's be built with -DBUILD_SHARED_LIBS=OFF?
$ ls *.so
More information about the llvm-dev