From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6242 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 20:13:56 +0200 Message-ID: <20141001181356.GQ21835@port70.net> References: <20141001161020.GO21835@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 1412187255 7095 80.91.229.3 (1 Oct 2014 18:14:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Oct 2014 18:14:15 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6255-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 01 20:14:09 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 1XZOPg-00009T-WD for gllmg-musl@plane.gmane.org; Wed, 01 Oct 2014 20:14:09 +0200 Original-Received: (qmail 3592 invoked by uid 550); 1 Oct 2014 18:14:08 -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 3581 invoked from network); 1 Oct 2014 18:14:08 -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:6242 Archived-At: * stephen Turner [2014-10-01 13:54:25 -0400]: > On Wed, Oct 1, 2014 at 12:10 PM, Szabolcs Nagy wrote: > > - 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 ... i meant running gcc -v test.c not the configure thing (so we know if the compiler works at all before starting to debug the configure script) > - in the executable is the loader properly set up (readelf)? > check if the machine type/abi is ok: readelf -h a.out 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) > - check if the loader/libc at the right path > ls -l /lib/ld-musl-* > - can you run the executable with the loader explicitly? run /lib/ld-musl-ARCH.so.1 ./a.out > > - strace the executable, where does it fail? strace ./a.out > > I dont know how to do what your asking here is there a site i can ref on > these troubleshooting steps? if you are not experienced with toolchains i'd try alpine or sabotage linux first you might be able to customize them to your liking