Re: -fPIC

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: -fPIC
Date: 2005-09-12 07:06:03
Message-ID: 20050912070558.GA3114@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 11, 2005 at 10:32:51PM -0400, Tom Lane wrote:
> Greg Stark <gsstark(at)mit(dot)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(at)svana(dot)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.

In response to

Responses

  • Re: -fPIC at 2005-09-12 17:28:46 from Kurt Roeckx

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Michel Pouré 2005-09-12 08:17:35 Materialized Views in PostgreSQL
Previous Message Qingqing Zhou 2005-09-12 06:30:44 Re: Spinlocks, yet again: analysis and proposed patches