Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120516220457.GU17860@port70.net>
Date: Thu, 17 May 2012 00:04:57 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: gcc segfault at src/mman/mlockall.c

* Isaac Dunham <idunham@...abit.com> [2012-05-16 11:53:41 -0700]:
> On Tue, 15 May 2012 21:30:53 +0200
> > i could try it meanwhile, it works but --version does not :)
> > so you can use
> > CC='musl-gcc -V 4.1'
> same situation here
> but when you just told it the version to use, why ask?
just to see if -V really worked :)

> By the way, would you have pointers on using pcc with musl?
> Is it possible to use it as a glibc -> musl cross-compiler ?
> ..seems that the official "cross-compiler" method might work for
> that...if binutils doesn't pose a problem.

i'm not sure what is a glibc->musl cross-compiler

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


if you want to compile musl itself with pcc
iirc you only have to change -lgcc into -lpcc
in the Makefile

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.