From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/837 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: Re: gcc segfault at src/mman/mlockall.c Date: Wed, 16 May 2012 23:07:16 -0700 Message-ID: <20120516230716.11df4881@newbook> References: <20120515093553.18c90a66@newbook> <20120515094236.53718e47@newbook> <20120515192104.GQ17860@port70.net> <20120515193053.GR17860@port70.net> <20120516115341.27f0c77b@newbook> <20120516220457.GU17860@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 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1337234853 23057 80.91.229.3 (17 May 2012 06:07:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 May 2012 06:07:33 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-838-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 17 08:07:32 2012 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 1SUts4-000746-6P for gllmg-musl@plane.gmane.org; Thu, 17 May 2012 08:07:32 +0200 Original-Received: (qmail 15890 invoked by uid 550); 17 May 2012 06:07:31 -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 15879 invoked from network); 17 May 2012 06:07:31 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=BceMQ0OxLoBqfdoWvJdW5E1Dya26kNuw5srH2MZRMBznaLOjHIuaFNTAgcL5sSKRkKnUYe6RA5DEMHF9pNrrANMLO+enhG29KTA3ewrxCDSe6zMN6lYe6rr80Bg32vF5z9/dkGt+sDptkLeyqQxBsN81xPAIfHZZvSHQKBU9UIk=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <20120516220457.GU17860@port70.net> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.20.1; i486-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:837 Archived-At: On Thu, 17 May 2012 00:04:57 +0200 Szabolcs Nagy wrote: > i'm not sure what is a glibc->musl cross-compiler Built on glibc, targets musl (similar to musl-gcc, though a strict cross-compiler is a little more complex) > i used something like the following to compile with pcc using musl > libc > MUSL=/path/to/musl > PCC=`pcc -v foobar.o 2>&1 |sed -n 's,.* > \([^ ]*\)/lib/crtbegin.o.*,\1,p'` > > x.o: x.c > pcc $(CFLAGS) -nostdinc -isystem $(MUSL)/include -isystem > $(PCC)/include -c -o $@ $< x-static1: x.o > ld -X -d -e _start -Bstatic -o $@ $< $(LDFLAGS) > $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o \ $(PCC)/lib/crtbegin.o > $(PCC)/lib/crtend.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -L$(PCC)/lib > -lpcc x-static2: x.o pcc -static -nostdlib -o $@ $< $(LDFLAGS) > $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o \ $(PCC)/lib/crtbegin.o > $(PCC)/lib/crtend.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -L$(PCC)/lib > -lpcc x-dynamic1: x.o ld -X -d -e _start > -dynamic-linker /lib/ld-musl-i386.so.1 -o $@ $< $(LDFLAGS) > $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o \ $(PCC)/lib/crtbegin.o > $(PCC)/lib/crtend.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -L$(PCC)/lib > -lpcc x-dynamic2: x.o pcc -nostdlib > -Wl,-dynamic-linker,/lib/ld-musl-i386.so.1 -o $@ $< $(LDFLAGS) > $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o \ $(PCC)/lib/crtbegin.o > $(PCC)/lib/crtend.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -L$(PCC)/lib > -lpcc For static, I can do it about like so (shell): # Pass 1: headers pcc $@ -nostdinc -isystem $MUSL/include -isystem $PCC/include # Pass 2: linking executables STARTOBJ="$MUSL/lib/crti.o $MUSL/lib/crt1.o $PCC/lib/crtbegin.o" ENDOBJ="$PCC/lib/crtend.o $MUSL/lib/crtn.o -L$MUSL/lib -lc -L$PCC/lib \ -lpcc" pcc -nostdlib -static $STARTOBJ $@ $ENDOBJ Thanks! Isaac Dunham