Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 1 Oct 2014 13:54:25 -0400
From: stephen Turner <stephen.n.turner@...il.com>
To: musl@...ts.openwall.com
Subject: Re: converting gcc from glibc to musl

On Wed, Oct 1, 2014 at 12:10 PM, Szabolcs Nagy <nsz@...t70.net> wrote:

> * stephen Turner <stephen.n.turner@...il.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.
>

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.