mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: converting gcc from glibc to musl
Date: Wed, 1 Oct 2014 22:44:35 +0200	[thread overview]
Message-ID: <20141001204434.GR21835@port70.net> (raw)
In-Reply-To: <CAA7aPHjAm67x72c_SZUdu5y3PLD0Ang=E5vg6_5cCNuBC9ft2Q@mail.gmail.com>

* stephen Turner <stephen.n.turner@gmail.com> [2014-10-01 15:11:25 -0400]:
> On Wed, Oct 1, 2014 at 2:13 PM, Szabolcs Nagy <nsz@port70.net> wrote:
> > i meant running
> >
> >  gcc -v test.c
> >
...
> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i586'
>  /usr/lib/gcc/i486-linux-gnu/4.7/collect2 --sysroot=/ --build-id
> --no-add-needed --eh-frame-hdr -m elf_i386 --hash-style=both
> -dynamic-linker /lib/ld-linux.so.2

this is not a musl based toolchain, it uses the wrong dynamic-linker

> > check if the musl loader is set up as expected:
> >
> >  readelf -l a.out
> >
> > (in case of dynamic linking the interpreter should be
> > /lib/ld-musl-ARCH.so.1 otherwise there should be no
> > interpreter)
> >
> 
> 
> Elf file type is EXEC (Executable file)
> Entry point 0x8048240
> There are 7 program headers, starting at offset 52
> 
> Program Headers:
>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>   PHDR           0x000034 0x08048034 0x08048034 0x000e0 0x000e0 R E 0x4
>   INTERP         0x000114 0x08048114 0x08048114 0x00013 0x00013 R   0x1
>       [Requesting program interpreter: /lib/ld-linux.so.2]

here it should say /lib/ld-musl-$ARCH.so.1

> > ls -l /lib/ld-musl-*
> >
> 
> not exactly, i found /lib/libc.so but no ld-musl* i created a symlink of
> ld-musl* to libc.so and gcc is able to work (initially gcc doesnt work as
> it cant find the lib it needs) but a.out continues to fail.
> 
> > run
> >
> > /lib/ld-musl-ARCH.so.1 ./a.out
> >
> 
> Yes, this works! albiet i used /lib/libc.so
> 

ok so fix your toolchain to pass the right -dynamic-linker
to the linker and it will probably work


  reply	other threads:[~2014-10-01 20:44 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
2014-10-01 18:13     ` Szabolcs Nagy
2014-10-01 19:11       ` stephen Turner
2014-10-01 20:44         ` Szabolcs Nagy [this message]
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=20141001204434.GR21835@port70.net \
    --to=nsz@port70.net \
    --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).