Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 24 Dec 2021 10:47:59 +0100
From: Markus Wichmann <>
Subject: Re: [Question] Statically compile and link C++ against musl
 on Ubuntu (musl-gcc)

On Fri, Dec 24, 2021 at 07:37:04AM +0000, Timo Lange wrote:
> Is there any way to compile a C++ program on Ubuntu entirely static (against musl)?

musl is a libc implementation. As such it contains all standard C
headers and all POSIX functions. In order to use the C++ standard
library with musl, however, you require an implementation of the C++
standard library. libcxx has, to my knowledge, been the most popular
choice to go along with musl, though GCC seems to like its libstdc++
more. I am sure a search engine will counsel you further in this matter

> And if so, would this work with a "proper" amd64 -> aarch64 cross-compiler? So I could get rid of QEMU.

musl can be cross-compiled with the standard options for
cross-compilation. You compile a cross-gcc (and its libgcc) for the
target you want, then compile musl with that cross-gcc, then compile g++
with musl, and then that somehow already contains a libstdc++, or else
you use libcxx. Again, I suggest a search engine.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.