mailing list of musl libc
 help / color / mirror / code / Atom feed
* shared musl with PCC as system compiler
@ 2012-10-14  7:15 Isaac Dunham
  2012-10-14 13:38 ` Luca Barbato
  2012-10-14 15:29 ` Rich Felker
  0 siblings, 2 replies; 4+ messages in thread
From: Isaac Dunham @ 2012-10-14  7:15 UTC (permalink / raw)
  To: musl

This is mainly a mix of what I've worked out previously and what Rich and I worked out on IRC. I figured posting it on the list would help those who want to use pcc as compiler...
0. Get today's (Oct 13) git HEAD or later! Otherwise libc.so will be broken.
Get a fairly recent pcc from CVS (the last month should be good enough)
When compiling pcc-libs, use 
make CFLAGS="-fPIC ${OPTFLAGS}"
(otherwise you get textrels in libc.so, which doesn't work)
1. Set LIBCC to -L$(dirname `pcc -print-file-name=libpcc.a`) -lpcc 
#-lpccsoftfloat may be needed for some systems
2. Add 
CFLAGS_ALL_SHARED += -D__PIC__=1
to config.mak (pcc doesn't define this with -fPIC at present, which is a bug)
3. Find the right -m* options:
ld -march=native 
#look for the elf_* in the "Supported emulations" that matches your CPU
Change all occurences of -m* in config.mak to "-melf_<arch>"
(pcc doesn't parse -m*, which is at best an incompatible behavior)
4. Now you should be set to compile.

-- 
Isaac Dunham <idunham@lavabit.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-14 20:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-14  7:15 shared musl with PCC as system compiler Isaac Dunham
2012-10-14 13:38 ` Luca Barbato
2012-10-14 20:36   ` Isaac Dunham
2012-10-14 15:29 ` Rich Felker

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).