CFLAGS+= -fPIC per default?

Hendrik Scholz hscholz at raisdorf.net
Sat Feb 21 19:43:41 PST 2004


On Feb 21, 2004, at 9:59 PM, Christian Weisgerber wrote:
> Why are these shared objects not built with -fPIC in the first place?

Ask the authors of the third party applications :)
Most architectures don't need -fPIC and/or it slows them down (thanks 
for the
comment Peter!).
The ports I've dealt with either use a hand written Makefile without 
honoring
CFLAGS set in the environment or without having -fPIC set since i386 (I 
guess that
is what most of the guys test and run their stuff on) doesn't need it.
Ports utilizing GNU configure may check if -fPIC is supported but 
usually don't
set it since it's not needed on the developers system.

Btw: Just found this in man gcc on Mac OS 10.3:
-fPIC
            If supported for the target machine, emit 
position-independent
            code, suitable for dynamic linking and avoiding any limit on 
the
            size of the global offset table.  This option makes a 
difference on
            the m68k, m88k, and the SPARC.

            Position-independent code requires special support, and 
therefore
            works only on certain machines.

            -fPIC is the default on Darwin and Mac OS X.

This might be the reason why I didn't see all the -fPIC patches in 
darwinports.

Hendrik


-- 
Hendrik Scholz - hscholz at raisdorf.net - http://www.raisdorf.net/
cell phone: 404-606-5324 (US) 0160-1570-272 (DE)



More information about the freebsd-amd64 mailing list