From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14239 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Reinoud Koornstra Newsgroups: gmane.linux.lib.musl.general Subject: Re: where to find musl-gcc wrapper script Date: Mon, 17 Jun 2019 20:28:12 -0700 Message-ID: References: <20190617233023.GK1506@brightrain.aerifal.cx> <20190618024755.GM1506@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a7e562058b90b4bc" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="228189"; mail-complaints-to="usenet@blaine.gmane.org" Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-14255-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jun 18 05:28:41 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 1hd4nZ-000xGu-0e for gllmg-musl@m.gmane.org; Tue, 18 Jun 2019 05:28:41 +0200 Original-Received: (qmail 18042 invoked by uid 550); 18 Jun 2019 03:28:38 -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 18013 invoked from network); 18 Jun 2019 03:28:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IdqY0umn4sBECNq4pCNCN+p5/0CxpqvbzroLg51XqpQ=; b=gBBYGqy3FQXPCIuzn58bSa/DddBxGVJjyWPxCvK0hNbAy4547HFLvRNj74y0Nn59WM t5O523nNpaaqoX+IYHvJ8Y2Po06IfJJm7w50Ho1qbqoQYXaz1leWMwoszP0S1NzhkJt3 iF+WOsvY2ouuxSM/8RVEOxCmDhsJO717SWUkSibqBUdz9/OT/diBSRrpaugkI+rpEwv5 tNk4p1wKzQlEgdwDyFxSus8yUpdoVrW7c8Cy8Mg49klaxlW8pVOoCwaxCWMhdByL5slB SrONeANAGY6ZBdbYXOwBMVn3gJx8/iEODwvvEQFlq8avK+B4/8wA7yb5MDqDKxPPdtu6 KE4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IdqY0umn4sBECNq4pCNCN+p5/0CxpqvbzroLg51XqpQ=; b=PA3hOfFjDbJpcmv94hih8AUt8MeXT7JBS+LQ1ribeiksY22mwFkSB74EHpEeoHxKad vE3K9Usf2iuXND5gHnA5rvJ6UHccBbtedchs0hz3XoUiOtZvjmXDbaFkbv6RbPihYIFD TE/6BdARXGVZ2crBrkdn8m3frOvPQj5K+LLozV8NJRew4h+eW/nUoKzepV6iClPFw+iM Q4Qhye5+wu4eXSCXyRVcvp+qFOuIxnYsKKrl+ZI6C18LyOA0UZ9msUCPAxRiHSmdPcER fU1e16BbrAlm2ckA1Ws1gk36KPaDvTWH33snjj+65D3qIKhP8VMiny13lUa48vXxI17g qN7A== X-Gm-Message-State: APjAAAVpy9RTrdbMl9bIwRFXjo+oCuueYVovATMsBzMM/acp0Z5zJlK/ SijvFRKDUeQa14dNecHQX5Om2+bDgWqo9M+Niy0+zw== X-Google-Smtp-Source: APXvYqwq00okOHEhUa3Ov2JfWzrRaA4Z4cAEENvjSXdzgBLBNkva4KrOItUNR6C2+N0zVdbw8rEG9CDinOd+ttxMMHw= X-Received: by 2002:a9d:6a19:: with SMTP id g25mr431592otn.77.1560828506005; Mon, 17 Jun 2019 20:28:26 -0700 (PDT) In-Reply-To: <20190618024755.GM1506@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:14239 Archived-At: --000000000000a7e562058b90b4bc Content-Type: text/plain; charset="UTF-8" On Mon, Jun 17, 2019, 7:47 PM Rich Felker wrote: > 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. > Yes, I noticed, so how can I force it to link against musl as well? > > 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. > Also done that, in that case should I just use the compiled gcc as cc? Thanks, Reinoud. > > 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 > --000000000000a7e562058b90b4bc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Jun 17, 2019, 7:47 PM Rich Felker <dalias@libc.org> wrote:
On Mon, Jun 17, 2019 at 07:30:00PM -0700, Reinoud K= oornstra wrote:
> Ok the wrapper is included in the musl library itself in the obj direc= tory.

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 hea= der"
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=3Dmusl-gcc
> CFLAGS=3D"-I/home/me/MUSL/include" LDFLAGS=3D"-L/home/m= e/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.

Yes, I not= iced, so how can I force it to link against musl as well?

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=3Dx86_64-linux-musl OUTPUT=3D/some/dir install" -- i= t 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.

Also done= that, in that case should I just use the compiled gcc as cc?

Thanks,

Reinoud.

Rich


> On Mon, Jun 17, 2019 at 5:54 PM Reinoud Koornstra
> <reinoudkoornstra@gmail.com> 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 <dalias@libc.org&= gt; 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-gc= c script to compile.
> > >
> > > The musl-gcc wrapper script is for repurposing an existing h= ost
> > > 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-n= ative
> > > system. The output of musl-cross-make will be a set of utili= ties
> > > prefixed with the target tuple, e.g. x86_64-linux-musl-gcc, = etc., in
> > > the bin directory under wherever you installed the cross too= lchain.
> > >
> > > Rich
--000000000000a7e562058b90b4bc--