From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6251 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: converting gcc from glibc to musl Date: Wed, 1 Oct 2014 22:44:35 +0200 Message-ID: <20141001204434.GR21835@port70.net> References: <20141001161020.GO21835@port70.net> <20141001181356.GQ21835@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1412196293 935 80.91.229.3 (1 Oct 2014 20:44:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Oct 2014 20:44:53 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6264-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 01 22:44:48 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 1XZQlT-00005T-Rs for gllmg-musl@plane.gmane.org; Wed, 01 Oct 2014 22:44:47 +0200 Original-Received: (qmail 3735 invoked by uid 550); 1 Oct 2014 20:44:47 -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 3727 invoked from network); 1 Oct 2014 20:44:47 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:6251 Archived-At: * stephen Turner [2014-10-01 15:11:25 -0400]: > On Wed, Oct 1, 2014 at 2:13 PM, Szabolcs Nagy 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