mailing list of musl libc
 help / color / mirror / code / Atom feed
From: stephen Turner <stephen.n.turner@gmail.com>
To: musl@lists.openwall.com
Subject: Re: converting gcc from glibc to musl
Date: Wed, 1 Oct 2014 13:54:25 -0400	[thread overview]
Message-ID: <CAA7aPHj4dkTXeEJVZXz=pch=SqA181KA7w1mP9pE=Eov=ZOEew@mail.gmail.com> (raw)
In-Reply-To: <20141001161020.GO21835@port70.net>

[-- Attachment #1: Type: text/plain, Size: 4577 bytes --]

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. 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 <stdio.h>
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.
>

[-- Attachment #2: Type: text/html, Size: 7010 bytes --]

  reply	other threads:[~2014-10-01 17:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 15:37 stephen Turner
2014-10-01 16:10 ` Szabolcs Nagy
2014-10-01 17:54   ` stephen Turner [this message]
2014-10-01 18:13     ` Szabolcs Nagy
2014-10-01 19:11       ` stephen Turner
2014-10-01 20:44         ` Szabolcs Nagy
2014-10-01 19:00     ` Samuel Holland
2014-10-01 19:13       ` stephen Turner
2014-10-01 19:35         ` Samuel Holland
2014-10-01 19:44           ` stephen Turner
2014-10-01 20:17             ` Samuel Holland
2014-10-01 20:34               ` stephen Turner
2014-10-01 20:43                 ` stephen Turner
2014-10-01 20:54                 ` Samuel Holland
2014-10-02 20:31                   ` stephen Turner
2014-10-02 20:47                     ` Samuel Holland
2014-10-02 22:40                       ` stephen Turner
2014-10-03 13:51                         ` stephen Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA7aPHj4dkTXeEJVZXz=pch=SqA181KA7w1mP9pE=Eov=ZOEew@mail.gmail.com' \
    --to=stephen.n.turner@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).