From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6240 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: Wed, 1 Oct 2014 13:54:25 -0400 Message-ID: References: <20141001161020.GO21835@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113312a6c5252f050460308b X-Trace: ger.gmane.org 1412186085 22929 80.91.229.3 (1 Oct 2014 17:54:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Oct 2014 17:54:45 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6253-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 01 19:54:39 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 1XZO6o-0008Vp-BK for gllmg-musl@plane.gmane.org; Wed, 01 Oct 2014 19:54:38 +0200 Original-Received: (qmail 20372 invoked by uid 550); 1 Oct 2014 17:54:37 -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 20364 invoked from network); 1 Oct 2014 17:54:37 -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=pG/4+5u6S8J8w3WWzc5KmS5yLerZB+otjQrpt4eK0gM=; b=ykXFQidI3jOf9/F8lQgJ8nhNk3nxpSbYpXAWwUL/09+LVKCswM9k/p0NIFTfasTjzS SoBUlw/FlVDAuMZxy/mnMtRLPPgJilElEWaHYgGU9ZtdV+0eFtUAyl8ueKraVsrRch74 vdp01EkY9os0KMz0ABHnweQsuVnAfGFHxQicrIn70CTV4LUx/+XjTKJKEgF7edi9v4Q6 IXzndIVzm/Rj7Voz71H3Eh9mmy4y/96OArPbApBwo/k/OJsGdCgeIfV1sjE7jJbA4IQz p4wi3P8xGS/oUDYGksbDXH5xAP3simrMGGk7bRrmoc0sPZEJfZBuhxUBJo6at23xbXoW RIIA== X-Received: by 10.221.64.142 with SMTP id xi14mr20288617vcb.31.1412186065150; Wed, 01 Oct 2014 10:54:25 -0700 (PDT) In-Reply-To: <20141001161020.GO21835@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:6240 Archived-At: --001a113312a6c5252f050460308b Content-Type: text/plain; charset=UTF-8 On Wed, Oct 1, 2014 at 12:10 PM, Szabolcs Nagy wrote: > * stephen Turner [2014-10-01 11:37:22 -0400]: > > Im having a really hard time getting this working correctly. Long story > > short i have probobly made every mistake possible but now i have a system > > with busybox, make, bash, musl (no wrapper) 3.2 headers (using 3.2 debian > > kernel) and a patched binutils-2.24 and gcc-4.6.4 (with math libs) > > > > I compile everything static and use the musl-gcc wrapper installed on by > > host system to compile binutils and gcc. everything runs in the target > > system but i get a error when running configure that talks about the > a.out > > file is not executable and gcc cannot compile programs (it does make the > > a.out file though it just cant run) > > > > do you have a static linked gcc with musl support on the target? > does the configure script run on the target? > you need to be more clear and provide more information like: > > - can gcc compile a minimal program (empty main)? > I can compile the following program sucessfully to a.out but cannot run it. # include main() { printf("hello world\n"); } gcc test.c && chmod +x a.out && ./a.out > - where does gcc/ld fail, how were they invoked (gcc -v)? configure:2078: loading cache /dev/null configure:2222: checking build system type configure:2236: result: i686-pc-linux-gnu configure:2283: checking host system type configure:2296: result: i686-pc-linux-gnu configure:2316: checking target system type configure:2329: result: i686-pc-linux-gnu configure:2383: checking for a BSD-compatible install configure:2451: result: /usr/bin/install -c configure:2462: checking whether ln works configure:2484: result: yes configure:2488: checking whether ln -s works configure:2492: result: yes configure:2499: checking for a sed that does not truncate output configure:2563: result: /bin/sed configure:2572: checking for gawk configure:2602: result: no configure:2572: checking for mawk configure:2602: result: no configure:2572: checking for nawk configure:2602: result: no configure:2572: checking for awk configure:2588: found /usr/bin/awk configure:2599: result: awk configure:3913: checking for gcc configure:3929: found /bin/gcc configure:3940: result: gcc configure:4169: checking for C compiler version configure:4178: gcc --version >&5 gcc (GCC) 4.6.4 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:4189: $? = 0 configure:4178: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/bin/../libexec/gcc/i686-pc-linux-gnu/4.6.4/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../gcc/configure --prefix=/root/targetfs --disable-nls --disable-shared --without-headers --with-newlib --enable-languages=c --disable-multilib --disable-bootstrap : (reconfigured) ../gcc/configure --prefix=/root/targetfs --disable-nls --disable-shared --without-headers --with-newlib --enable-languages=c --disable-multilib --disable-bootstrap Thread model: posix gcc version 4.6.4 (GCC) configure:4189: $? = 0 configure:4178: gcc -V >&5 gcc: error: unrecognized option '-V' gcc: fatal error: no input files compilation terminated. configure:4189: $? = 1 configure:4178: gcc -qversion >&5 gcc: error: unrecognized option '-qversion' gcc: fatal error: no input files compilation terminated. configure:4189: $? = 1 configure:4209: checking for C compiler default output file name configure:4231: gcc conftest.c >&5 configure:4235: $? = 0 configure:4272: result: a.out configure:4288: checking whether the C compiler works configure:4297: ./a.out ../gcc/configure: line 4299: ./a.out: No such file or directory configure:4301: $? = 127 configure:4308: error: in `/gcc-build': configure:4312: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. - in the executable is the loader properly set up (readelf)? - check if the loader/libc at the right path - can you run the executable with the loader explicitly? > - strace the executable, where does it fail? > I dont know how to do what your asking here is there a site i can ref on these troubleshooting steps? > > > would this be an issue with my headers/libs or binutils/gcc ? > > > > The end goal here is to create the most vanilla system possible that can > > dynamically use musl. albiet ive chosen some rather un-vanilla programs > for > > the base. > --001a113312a6c5252f050460308b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Wed, Oct 1, 2014 at 12:10 PM, Szabolcs Nagy <nsz@port70.net> wrote:
* stephen Turner <stephen.n.turner@gmail.com>= ; [2014-10-01 11:37:22 -0400]:
> Im having a really hard time getting this working correctly. Lon= g story
> short i have probobly made every mistake possible but now i have a sys= tem
> with busybox, make, bash, musl (no wrapper) 3.2 headers (using 3.2 deb= ian
> kernel) and a patched binutils-2.24 and gcc-4.6.4 (with math libs)
>
> I compile everything static and use the musl-gcc wrapper installed on = by
> host system to compile binutils and gcc. everything runs in the target=
> system but i get a error when running configure that talks about the a= .out
> file is not executable and gcc cannot compile programs (it does make t= he
> a.out file though it just cant run)
>

do you have a static linked gcc with musl support on the target?
does the configure script run on the target?
you need to be more clear and provide more information like:

- can gcc compile a minimal program (empty main)?

=
I can compile the following program sucessfully to a.out but can= not run it.

# include <stdio.h>
ma= in()
{
printf("hello world\n");
}

gcc test.c && chmod +x a.out &&= ./a.out

=C2=A0
- where does gcc/ld fail, how were they invoked (gcc -v)?=C2=A0

configure:2078: loading cache /dev/null
conf= igure:2222: checking build system type
configure:2236: result: i6= 86-pc-linux-gnu
configure:2283: checking host system type
configure:2296: result: i686-pc-linux-gnu
configure:2316: chec= king target system type
configure:2329: result: i686-pc-linux-gnu=
configure:2383: checking for a BSD-compatible install
= configure:2451: result: /usr/bin/install -c
configure:2462: check= ing whether ln works
configure:2484: result: yes
config= ure:2488: checking whether ln -s works
configure:2492: result: ye= s
configure:2499: checking for a sed that does not truncate outpu= t
configure:2563: result: /bin/sed
configure:2572: chec= king for gawk
configure:2602: result: no
configure:2572= : checking for mawk
configure:2602: result: no
configur= e:2572: checking for nawk
configure:2602: result: no
co= nfigure:2572: checking for awk
configure:2588: found /usr/bin/awk=
configure:2599: result: awk
configure:3913: checking f= or gcc
configure:3929: found /bin/gcc
configure:3940: r= esult: gcc
configure:4169: checking for C compiler version
<= div>configure:4178: gcc --version >&5
gcc (GCC) 4.6.4
Copyright (C) 2011 Free Software Foundation, Inc.
This is f= ree software; see the source for copying conditions.=C2=A0 There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PU= RPOSE.

configure:4189: $? =3D 0
configur= e:4178: gcc -v >&5
Using built-in specs.
COLLECT= _GCC=3Dgcc
COLLECT_LTO_WRAPPER=3D/bin/../libexec/gcc/i686-pc-linu= x-gnu/4.6.4/lto-wrapper
Target: i686-pc-linux-gnu
Confi= gured with: ../gcc/configure --prefix=3D/root/targetfs --disable-nls --disa= ble-shared --without-headers --with-newlib --enable-languages=3Dc --disable= -multilib --disable-bootstrap : (reconfigured) ../gcc/configure --prefix=3D= /root/targetfs --disable-nls --disable-shared --without-headers --with-newl= ib --enable-languages=3Dc --disable-multilib --disable-bootstrap
= Thread model: posix
gcc version 4.6.4 (GCC)=C2=A0
confi= gure:4189: $? =3D 0
configure:4178: gcc -V >&5
g= cc: error: unrecognized option '-V'
gcc: fatal error: no = input files
compilation terminated.
configure:4189: $? = =3D 1
configure:4178: gcc -qversion >&5
gcc: err= or: unrecognized option '-qversion'
gcc: fatal error: no = input files
compilation terminated.
configure:4189: $? = =3D 1
configure:4209: checking for C compiler default output file= name
configure:4231: gcc =C2=A0 =C2=A0conftest.c =C2=A0>&= 5
configure:4235: $? =3D 0
configure:4272: result: a.ou= t
configure:4288: checking whether the C compiler works
configure:4297: ./a.out
../gcc/configure: line 4299: ./a.out: No= such file or directory
configure:4301: $? =3D 127
conf= igure:4308: error: in `/gcc-build':
configure:4312: error: ca= nnot run C compiled programs.
If you meant to cross compile, use = `--host'.
See `config.log' for more details.
- in the executable is the loader properly set up (readelf)?
- check if the loader/libc at the right path=C2=A0
- can you run the executable with the loader explicitly?
- strace the executable, where does it fail?

I dont know how to do what your asking here is there a site i can ref= on these troubleshooting steps?
=C2=A0

> would this be an issue with my headers/libs or binutils/gcc ?
>
> The end goal here is to create the most vanilla system possible that c= an
> dynamically use musl. albiet ive chosen some rather un-vanilla program= s for
> the base.

--001a113312a6c5252f050460308b--