Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 14 Oct 2012 00:15:34 -0700
From: Isaac Dunham <idunham@...abit.com>
To: musl@...ts.openwall.com
Subject: shared musl with PCC as system compiler

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@...abit.com>

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.