From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14238 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: where to find musl-gcc wrapper script Date: Mon, 17 Jun 2019 22:47:55 -0400 Message-ID: <20190618024755.GM1506@brightrain.aerifal.cx> References: <20190617233023.GK1506@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="70998"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: musl@lists.openwall.com To: Reinoud Koornstra Original-X-From: musl-return-14254-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jun 18 04:48:15 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hd4AN-000ILB-TZ for gllmg-musl@m.gmane.org; Tue, 18 Jun 2019 04:48:11 +0200 Original-Received: (qmail 3396 invoked by uid 550); 18 Jun 2019 02:48:09 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3373 invoked from network); 18 Jun 2019 02:48:08 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14238 Archived-At: On Mon, Jun 17, 2019 at 07:30:00PM -0700, Reinoud Koornstra wrote: > Ok the wrapper is included in the musl library itself in the obj directory. Yes, or installed in $prefix/bin if you install. If you don't install it won't be able to find its spec file. > c++ isn't supported yet? Right. Nobody I'm aware of understands the details of this, but apparently either GCC's actual C++ headers or its "precompiled header" versions of them pull in a bunch of stuff from glibc, and then it breaks when you try to reuse them with musl. It's probably not that hard to figure out the root cause and maybe even make it work, but nobody has done it and interest is low because it's still a big hack compared to just building a proper cross toolchain. > Currently I configure with CC=musl-gcc > CFLAGS="-I/home/me/MUSL/include" LDFLAGS="-L/home/me/lib" ./configure > the final g++ comand also add -lrt, need more changes for this to work? If you do that you're compiling against musl's headers but then linking against glibc, which is going to make a huge broken mess. If you need C++, you really should just build a cross toolchain with musl-cross-make. It's as simple as clining the mcm repo and running "make TARGET=x86_64-linux-musl OUTPUT=/some/dir install" -- it will download, check hashes on, and patch all the components you need and give you a clean self-contained cross toolchain in the OUTPUT dir. Rich > On Mon, Jun 17, 2019 at 5:54 PM Reinoud Koornstra > wrote: > > > > In this case, my application is simple, I need to compile and > > application against musl, instead of glibc. > > I do not need to musl compiled gcc for this? > > Thanks, > > Reinoud. > > > > On Mon, Jun 17, 2019 at 4:30 PM Rich Felker wrote: > > > > > > On Mon, Jun 17, 2019 at 03:49:19PM -0700, Reinoud Koornstra wrote: > > > > Hello Everyone, > > > > I did get the sources and build from musl-cross-gcc at github.com. > > > > Building works fine, however, I cannot find the musl-gcc script to compile. > > > > > > The musl-gcc wrapper script is for repurposing an existing host > > > toolchain for a different libc (glibc) to use it with musl. You don't > > > use it with a proper cross compiler toolchain or on a musl-native > > > system. The output of musl-cross-make will be a set of utilities > > > prefixed with the target tuple, e.g. x86_64-linux-musl-gcc, etc., in > > > the bin directory under wherever you installed the cross toolchain. > > > > > > Rich