Re: Use -fvisibility=hidden for shared libraries - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Use -fvisibility=hidden for shared libraries
Date
Msg-id 20211101054700.z3jzmc5lnxlad4y7@alap3.anarazel.de
Whole thread Raw
In response to Re: Use -fvisibility=hidden for shared libraries  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Use -fvisibility=hidden for shared libraries
List 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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Missing include in be-secure-openssl.c?
Next
From: Peter Eisentraut
Date:
Subject: Re: Time to drop plpython2?