From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4471 invoked from network); 24 Dec 2021 07:37:19 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 24 Dec 2021 07:37:19 -0000 Received: (qmail 3790 invoked by uid 550); 24 Dec 2021 07:37:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 3757 invoked from network); 24 Dec 2021 07:37:16 -0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EqQi09RNYhFc5Ia8fzoxdOTwY9a7ZsoQq8m7H1SpgPI/yYDqLUmvl4CnHPJpfubB26g9MsQmIu56BjwQ2GIGyes9kumGHYsLwqK+iXjhkRl0Se5ekmulpuR2d8A7jPjjs6t+mKKyrw/o2UebpNO+g42rt2L+VNfliyuTd0ca8/ph/xuygUWT6mEv21NpLi2Bu05xLSJ9th38g7ylf0xGVy+9CLPUlFDYBxpsE4uq8uj6UAz774ZwdTc3NHxydOL/DIKcgYu8lwsuFwwDJ/EASaPsgfqo/In2/gduGxk7G7HkyvBz8MWEYddlGDXFeQ/H/3ogR5ZCSrOQyODAu0A0RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9In9+ipl76Uh3X5ZKD3121VygAOldpBGTY0QzVRNucc=; b=OLclfAHoufSGPGnR/6TdXcOtsOTO36rX+1OtrRb8vmBNVrJHdClDSbGjeF3uNRilQ5A4N5f/DT210XFyvtRnBN8s7Cd9Rg0+1tNjTLrLwyT3emGo19AoHQAxdCTpa1hSTLBdBXM3vafuTlMUMQW1o6euB8RHKl1r8Fu/6dCwvBLMEm0M5PY2dhIc+bCDmR1HX3h1b9Go1xWcBY05hVUMfL2VrtuLmCkkfZ688wtZ9HiNEHx8TFIFJ6Pn9IYBmOqk4sJUAbYI0xIEXbgLNsg/yr4Vi4AQ7LBEBM/6yTXWaTKF/0rnwRD9zwEQcD0BCQ1ODHi7dEJFlYrnsIl78CpPTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none From: Timo Lange To: "musl@lists.openwall.com" Thread-Topic: [Question] Statically compile and link C++ against musl on Ubuntu (musl-gcc) Thread-Index: AQHX+JjEoN2uByKyEkW2e5z2ueqEmg== Date: Fri, 24 Dec 2021 07:37:04 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [DK6Av+VsZVdWXHHR39wYiB9EeYdG0P7E] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 45217954-66fb-4187-e6a8-08d9c6b02e3f x-ms-traffictypediagnostic: AM0PR04MB5988:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O4hYHgX7VCeXYI8kolkBiz49QLl+iU0HBHZXIlw9NDhJ/o+c0wfg6m2iD79vZov4ab3XydW60K00louvgvIYmb3mF6V3QwKlWQHkEJNP+vHccNy1QNbatYXE37bEzJNrBUnOSqqUhk+LMj/ZzI2joiIkIk1BWL0xOWa7IRbVUOr3YtC7t5qmcuWtbt3GhbANtstt5Ip9TIPzTIFMegBJSFtbZIvUCHHdZTFgLHxRwlwniy8u2CImWDFdQt6G9SILlnmAXc5kcUj8RtJsn554x+aZ/+LuCgSVEScaKxsTFMr93JO5e0GYTTqjbTKkD7lpGXtGSWuCWYpv/rVdxRC1MtHAdJS51c8Ghsnw5PcFd+tZx5SfenZVsat08AtusTrYleh8GJsrJM5qPYcpzLrcSvjFrZw9e3kYi7GDF5yN0QcPIdKt3IlfbV9hABxBGA74d1ggD/Nb2cczqZ275TuxwXU/00ykoumRFqM00mHwazfWB3V/HknVoJsZLvlWjNWgJPQ7rFD1BQSKW+sVWfYyIk9ESes3CH1VCz3Hec0VhGMDNL/FXg6WV+bSv26+ueKqo83XbSRobtCBW4PWsl3DFw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Z5Kchk+NmZjiMqlmqVP5xE1UW5CgVwXiAbcIweGLtIZCNfOZTPgFwj5n9J72?= =?us-ascii?Q?L8wGC9l71GbVCo9jJqIFZdVWJhVFNJNvBlmfao5z2Z5rqQ771gOW3WwiH6qP?= =?us-ascii?Q?T+GR7LVgsY96PezlgFPuZJ1WjtlaX3Brc3VFStn6YuwVk5mjyHF1ZJ0rSYQ+?= =?us-ascii?Q?5E3npgnvTDGXmvH/m+DQfV82lFJAKAt0X7L05bFor26SjVY3+dGAWxy12fko?= =?us-ascii?Q?AJ6APdgJAgZxnwMDc2ftTrezyVE47xufv7W0CSry2fUWJjQ15Lindm14DNHa?= =?us-ascii?Q?aMDSDaVdI2vugljVRsSzHByiRJpPdPlU3mNadW78qt4piVO2FP/yYCjpg5aN?= =?us-ascii?Q?lGGgGrezdklzQ5TFBfdYVPYt2iUdgiVQAmdPerne0uHzd/iYqc7q4bgff1rG?= =?us-ascii?Q?Szx21Gq1N8b0INFIylxVsnCXVPG6SkbTPIh4gcPpKdWGI6bQ1Dunzii9FKZS?= =?us-ascii?Q?t1mCvPMQRXlvI+u0xwlYkYUkZnrcLXkqOI/Q3Jtf80k91l2s01g+zapa+El6?= =?us-ascii?Q?H2rD6F5WjC8JBgF3sOqMOGLgt78nsfwbzxj1PspuV1PC4PY07Gix0uOL2FP1?= =?us-ascii?Q?N23+CunecVOflKLWHOCP0gLROgBStWr0VuoHKkTJQK9AXeOyamW+xFkPDDlA?= =?us-ascii?Q?vCGvPzdYyw2EXQEnm6bNemXdD2yJtlNcLWfV25q1LKr/03/78HP0zemOx1Uj?= =?us-ascii?Q?g5FXECporQvK7Gl7+Ze7+MdWvU1+WiV8M0kN/Zam4oEm3gCgBW3ZATpUFfN8?= =?us-ascii?Q?gyXYP7YNRtrCIysDef9+yKg2X6z7GIe+jUliLjH/Iu+ib0MZnJhGUZB47xYW?= =?us-ascii?Q?oY6ETuhkPGGalH4bX2K2WPhHLPzbp9R2xyr6mWBnFXr90zRCPBJCeg2TojXk?= =?us-ascii?Q?LSuFnYkBZHwhzlwtCgFSQNFVAHgE21uLSSzpLLBCTL5zcb8rUaRj/IpTmQCB?= =?us-ascii?Q?SVCj8jNVvbdCp3qO04jG9U3hRC2q1JCUnVM8eBu5n9Q=3D?= Content-Type: multipart/alternative; boundary="_000_AM0PR04MB56672EC6763A3E58DFC0C6B09D7F9AM0PR04MB5667eurp_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-03a34.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5667.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 45217954-66fb-4187-e6a8-08d9c6b02e3f X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2021 07:37:04.1494 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5988 Subject: [musl] [Question] Statically compile and link C++ against musl on Ubuntu (musl-gcc) --_000_AM0PR04MB56672EC6763A3E58DFC0C6B09D7F9AM0PR04MB5667eurp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hey there. I am currently compiling my C++ project against musl. The reason is that I need a fully static executable and glibc does not seem= to be suited for that case. Currently I am doing the compilation inside an Alpine based Docker image. U= sing buildx and QEMU I also cross-compile for aarch64 - which is terribly s= low. Apart from that, the problem I am facing with this approach is that a few t= ools I want to use (static code analysis, FOSS scan, etc.) do not run under= Alpine, as they require an Ubuntu loader. Of course I tried making them run under Alpine but I feel this is not a pro= per solution. Anyhow I have failed so far. So I came across musl-tools, resp. musl-gcc which is a wrapper around GCC o= n Ubuntu that "replaces" glibc libraries by musl. I am able to compile a si= mple C program with this, but not C++. It fails including any C++ header. I assume it supports only C, as the name musl-gcc indicates. Is there any way to compile a C++ program on Ubuntu entirely static (agains= t musl)? And if so, would this work with a "proper" amd64 -> aarch64 cross-compiler?= So I could get rid of QEMU. --_000_AM0PR04MB56672EC6763A3E58DFC0C6B09D7F9AM0PR04MB5667eurp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hey there.
I am currently compiling my C++ project against musl.
The reason is that I need a fully static executable and glibc does not seem= to be suited for that case.

Currently I am doing the compilation inside an Alpine based Docker image. U= sing buildx and QEMU I also cross-compile for aarch64 - which is terribly s= low.

Apart from that, the problem I am facing with this approach is that a few t= ools I want to use (static code analysis, FOSS scan, etc.) do not run under= Alpine, as they require an Ubuntu loader.

Of course I tried making them run under Alpine but I feel this is not a pro= per solution. Anyhow I have failed so far.

So I came across musl-tools, resp. musl-gcc which is a wrapper around GCC o= n Ubuntu that "replaces" glibc libraries by musl. I am able to co= mpile a simple C program with this, but not C++. It fails including any C++= header.
I assume it supports only C, as the name musl-gcc indicates.

Is there any way to compile a C++ program on Ubuntu entirely static (agains= t musl)?
And if so, would this work with a "proper" amd64 -> aarch64 cr= oss-compiler? So I could get rid of QEMU.
--_000_AM0PR04MB56672EC6763A3E58DFC0C6B09D7F9AM0PR04MB5667eurp_--