From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6254 Path: news.gmane.org!not-for-mail From: stephen Turner Newsgroups: gmane.linux.lib.musl.general Subject: Re: converting gcc from glibc to musl Date: Thu, 2 Oct 2014 16:31:14 -0400 Message-ID: References: <20141001161020.GO21835@port70.net> <542C4F58.70708@sholland.net> <542C579A.7090008@sholland.net> <542C615B.3050202@sholland.net> <542C6A08.7010107@sholland.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013cba227680640504767f29 X-Trace: ger.gmane.org 1412281894 1355 80.91.229.3 (2 Oct 2014 20:31:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Oct 2014 20:31:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6267-gllmg-musl=m.gmane.org@lists.openwall.com Thu Oct 02 22:31:28 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XZn27-0004vi-EP for gllmg-musl@plane.gmane.org; Thu, 02 Oct 2014 22:31:27 +0200 Original-Received: (qmail 28090 invoked by uid 550); 2 Oct 2014 20:31:26 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 28082 invoked from network); 2 Oct 2014 20:31:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=mwb5owIWnxoyuMIaONG8cAdSyAvc7ljSS3sy5ZkW460=; b=isdpFrNQKN7gpAg9tqTGnLP6tYUHoIRrxXL85Rj78jHyglnho65BbXveeAAnOdZ1+H /RhoOA8sn6XN/VvdbLCGPoIFdXOWPMyGI6RX2E8BRNwX9jvD5n0Fyul+ri7ZX3X2uXh5 53PXIltT4y6YulJgEZvYXk4aPQKuhBqWGg8INmyxlR3YHTsqsbn8kA4HlbVZUmvYUyaO jS2+erbRjfO+Vl78ZUULxSx9BNRdVDxOxXQu1jucc0Y6OCQs2d6QP+D0atAokXwx93SJ Kw/nNqAmuyqLly/07up1hDX0O9dBjDtMYsJ/T+ybuIkBj/bsDZghPpLfBSYPttdCd5Al 7Wyw== X-Received: by 10.220.250.142 with SMTP id mo14mr743947vcb.26.1412281874676; Thu, 02 Oct 2014 13:31:14 -0700 (PDT) In-Reply-To: <542C6A08.7010107@sholland.net> Xref: news.gmane.org gmane.linux.lib.musl.general:6254 Archived-At: --089e013cba227680640504767f29 Content-Type: text/plain; charset=UTF-8 since patching with the recommended patch (the one i had wasnt a full patch apparently) i have been able to use this option --host=i686-linux-musl however now when i compile i run into new issues. Firstly gmp, mpfr, and mpc do not like this flag obviously since they do not have the musl settings patched in so i cant compile with the musl wrapper because i cannot include those math libraries and when i try to prebuild them and use the flag --with-mpfr=/target/location it errors out saying it cant find any compatible versions of these libs/headers. that brings me to compiling without the musl wrapper but with --host=i686-linux-musl and that does work until you try to run the binary of gcc made static which gives the error cant execute or doesnt exist. Checking with ldd shows its static so the binary itself is corrupted in some way. My question now becomes, what would be the troubleshooting steps to see how its broke if possible? On Wed, Oct 1, 2014 at 4:54 PM, Samuel Holland wrote: > On 10/01/2014 03:34 PM, stephen Turner wrote: > >> Yea i had to patch gcc just to get it to compile which due to various >> issues i have only gotten to run on the target musl system when i use >> the musl wrapper to compile gcc. >> >> how would i go about fixing this linker issue? is it with binutils, gcc, >> or musl? >> > > See lines 77-79 of the musl-cross patch. When you set your triple to > i686-linux-musl instead of i686-linux-gnu, it sets musl as the default > linker. You didn't, so it defaults to glibc, but you can still tell it to > use musl manually, either by putting -mmusl in CFLAGS or the command line, > or by editing the specs file, like the musl-gcc wrapper does. > > Once you get it working, though, I recommend recompiling gcc with > --host=i686-linux-musl > > > -- > Regards, > Samuel Holland > --089e013cba227680640504767f29 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
since patching with the recommended patch (the one i had w= asnt a full patch apparently) i have been able to use this option --host=3D= i686-linux-musl however now when i compile i run into new issues.

<= /div>
Firstly gmp, mpfr, and mpc do not like this flag obviously since = they do not have the musl settings patched in so i cant compile with the mu= sl wrapper because i cannot include those math libraries and when i try to = prebuild them and use the flag --with-mpfr=3D/target/location it errors out= saying it cant find any compatible versions of these libs/headers.=C2=A0

that brings me to compiling without the musl wrappe= r but with --host=3Di686-linux-musl and that does work until you try to run= the binary of gcc made static which gives the error cant execute or doesnt= exist. Checking with ldd shows its static so the binary itself is corrupte= d in some way.

My question now becomes, what would= be the troubleshooting steps to see how its broke if possible?
=

On Wed, Oct 1, 20= 14 at 4:54 PM, Samuel Holland <samuel@sholland.net> wrote:=
On 10/01/2014 03:34 PM,= stephen Turner wrote:
Yea i had to patch gcc just to get it to compile which due to various
issues i have only gotten to run on the target musl system when i use
the musl wrapper to compile gcc.

how would i go about fixing this linker issue? is it with binutils, gcc, or musl?

See lines 77-79 of the musl-cross patch. When you set your triple to i686-l= inux-musl instead of i686-linux-gnu, it sets musl as the default linker. Yo= u didn't, so it defaults to glibc, but you can still tell it to use mus= l manually, either by putting -mmusl in CFLAGS or the command line, or by e= diting the specs file, like the musl-gcc wrapper does.

Once you get it working, though, I recommend recompiling gcc with --host=3D= i686-linux-musl


--
Regards,
Samuel Holland <samuel@sholland.net>

--089e013cba227680640504767f29--