While we discuss libtool (-fpic vs. -fPIC)

Kris Kennaway kris at obsecurity.org
Tue Feb 28 12:44:08 PST 2006


On Tue, Feb 28, 2006 at 03:31:28PM -0500, Mikhail Teterin wrote:
> ? ??, 2006-02-28 ? 15:11 -0500, Kris Kennaway ????:
> > Where I said "-fPIC and not -fpic is correct on amd64 and ia64."  On
> > i386 they are equivalent.  In fact now I'm not sure they're not
> > equivalent on amd64 and ia64 too (in which case the current situation
> > is still fine).
> 
> I don't think, they are equivalent. The lower-case variant is slightly
> more efficient. It can not be used on sparc64, except for shared
> libraries with very few symbols, but it is fine on other arches.

info gcc says

`-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 and the SPARC.

i.e. does not make a difference elsewhere.

> Here is a related thread at a PGSQL mailing list:
> 
> http://groups.google.com/group/pgsql.hackers/browse_thread/thread/4948c99d980ee2bd/9781cee632f281bc?lnk=st

Which says the same thing I am, e.g.:

--
The reason for -fpic vs -fPIC (on the machines where it makes any
difference at all) is that the former is faster. 
--
                 ^--e.g. on sparc and m68k.

--
The thing is, on i386 it makes no difference, it's only on some
archtechtures where it matters. And it has to do with both the size of
the symbol table and the size of the code. 
--

Also, Peter Wemm confirmed for me that -fpic and -fPIC are identical
on amd64.

Kris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20060228/a7d918fb/attachment.bin


More information about the freebsd-ports mailing list