Re: Use -fvisibility=hidden for shared libraries

From: Andres Freund <andres(at)anarazel(dot)de>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use -fvisibility=hidden for shared libraries
Date: 2021-11-01 05:47:00
Message-ID: 20211101054700.z3jzmc5lnxlad4y7@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-11-01 05:55:40 +0100, Laurenz Albe wrote:
> I see that at least clang and gcc support this flag.

Yes - and have for a long time. 2004 or so.

> Could the reduced number of exported functions be a problem, if someone
> relies on some function being exported? It may not be worth worrying about,
> and they can always come and make a case for that symbol to be exported.

Hm. Possible, but I don't think common. It's pretty rare to need symbols
from a postgres extension shared library from another shared
library. The most common case are transforms. To add a new transform
one, from what I've seen, needs to expose previously internal stuff from
an extension anyway... And transforms aren't all that common.

And yes, we can easily just add a few additional exports over time.

One nice advantage of this is that the !windows build behaves more
similar to the windows case, which makes it easier to detect build
breakages locally...

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-11-01 05:53:01 Re: Time to drop plpython2?
Previous Message Michael Paquier 2021-11-01 05:27:11 Re: Missing include <openssl/x509.h> in be-secure-openssl.c?