From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: [musl] [Question] Statically compile and link C++ against musl on Ubuntu (musl-gcc)
Date: Fri, 24 Dec 2021 10:47:59 +0100 [thread overview]
Message-ID: <20211224094759.GA2043@voyager> (raw)
In-Reply-To: <AM0PR04MB56672EC6763A3E58DFC0C6B09D7F9@AM0PR04MB5667.eurprd04.prod.outlook.com>
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.
Ciao,
Markus
prev parent reply other threads:[~2021-12-24 9:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-24 7:37 Timo Lange
2021-12-24 9:47 ` Markus Wichmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211224094759.GA2043@voyager \
--to=nullplan@gmx.net \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).