Re: -fPIC - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: -fPIC
Date
Msg-id 20050912070558.GA3114@svana.org
Whole thread Raw
In response to Re: -fPIC  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: -fPIC
List pgsql-hackers
On Sun, Sep 11, 2005 at 10:32:51PM -0400, Tom Lane wrote:
> Greg Stark <gsstark@mit.edu> writes:
> > ... mixing -fpic and -fPIC libraries is a problem.
>
> Is it?  I would think having two options would be essentially unworkable
> if so.

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.

Given that you don't know what you need to use until you compile it, if
people are compiling all their stuff with -fPIC you can at least be
sure that it won't break on other architectures.

The new gcc visibility stuff gives you way of shrinking the symbol
table and improving performance. There is a performance difference
between -fpic and -fPIC, whether it's big enough to care about...

You can shrink the symbol table with --version-script in LD, you
provide a script like:
{ global:   pg_finfo_*   <other exported symbols> local: *}

Whether it's enough... For people who want to know the gory details,
read this (by Ulrich Drepper).

http://people.redhat.com/drepper/dsohowto.pdf

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Spinlocks, yet again: analysis and proposed patches
Next
From: Jean-Michel Pouré
Date:
Subject: Materialized Views in PostgreSQL