[llvm-dev] Statically linking against libc++ (original) (raw)
Carsten Mattner via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 10 00:53:44 PDT 2017
- Previous message: [llvm-dev] Statically linking against libc++
- Next message: [llvm-dev] Statically linking against libc++
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Apr 10, 2017 at 4:59 AM, Mehdi Amini <mehdi.amini at apple.com> wrote:
What you build with clang and how clang is built aren’t related at all. You can build LLVM as a set of dynamic libraries, and still use clang to generate a statically linked binary.
Of course not and I can see how my message was ambiguous.
Since C++ code almost always needs a standard lib and given past precedents on Linux with glibc/libgcc/libstdc++, I asked myself if and how I can statically link libc++. This is a little more important because libc++ - unlike FreeBSD and macOS - is not necessarily on a system. Hence my static linking question. Looking closer, Arch linux has libc.a even though it doesn't install .a for packages by default so glibc's C stdlib must have been used in that clang++ -static foo.cc invocation.
This is good but since glibc may not link statically in all scenarios, do you know how I could run clang++ on a glibc Linux while delegating C stdlib to musl-libc? I mean, -nostdlib or -nodefaultlib could be used but then stuff gets hairy or too explicit quickly. I'm hoping -static could be made to use libc++.a, musl libc.a and maybe libunwind compiler-rt etc.
- Previous message: [llvm-dev] Statically linking against libc++
- Next message: [llvm-dev] Statically linking against libc++
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]