Re: Use -fvisibility=hidden for shared libraries
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Laurenz Albe <laurenz.albe@cybertec.at>, pgsql-hackers@postgresql.org
Date: 2022-07-17T20:06:28Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > That's also the reason -fvisibility=hidden isn't added to libpq and the ecpg > libs - their symbol visility is done via exports.txt. Depending on the > platform that'd not work if symbols were already hidden via > -fvisibility=hidden (unless explicitly exported via PGDLLEXPORT, of > course). Got it. Yeah, let's not break those cases. (I don't think we dare put PGDLLEXPORT into libpq-fe.h, for example, so it might be hard to solve it any other way anyhow.) >> 2. I'm not really thrilled with the symbol names C[XX]FLAGS_SL_MOD; >> it's not apparent what the MOD means, nor is that documented anywhere. > It's for module, which I got from pgxs' MODULES/MODULE_big (and incidentally > that's also what meson calls it). Definitely should be explained, and perhaps > be expanded to MODULE. I guessed as much, but +1 for spelling it out as MODULE. regards, tom lane
Commits
-
Mark all symbols exported from extension libraries PGDLLEXPORT.
- 8cf64d35eacc 16.0 landed
-
Default to hidden visibility for extension libraries where possible
- 089480c07705 16.0 landed
-
Remove now superfluous declarations of dlsym()ed symbols.
- fd4bad165539 16.0 landed
-
Add central declarations for dlsym()ed symbols
- f2b73c8d75d5 16.0 landed