Re: Mark all GUC variable as PGDLLIMPORT
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier <michael@paquier.xyz>, pgsql-hackers@lists.postgresql.org
Date: 2022-02-13T03:59:56Z
Lists: pgsql-hackers
Hi, On 2021-08-23 14:53:34 +0800, Julien Rouhaud wrote: > So since the non currently explicitly exported GUC global variables shouldn't > be accessible by third-party code, I'm attaching a POC patch that does the > opposite of v1: enforce that restriction using a new pg_attribute_hidden() > macro, defined with GCC only, to start discussing that topic. This fails on cfbot: https://cirrus-ci.com/task/6424663592009728?logs=build#L1 I'm not feeling a lot of enthusiasm for the change. But if we were to do this, we'd have to have infrastructure to detect missing hidden declarations, otherwise it's inevitable that they don't get added. I kind of like the idea of hiding postgres symbols for other reasons than win<->everything else parity. Namely that not exporting symbols can allow the compiler to optimize more... Greetings, Andres Freund
Commits
-
Remove PGDLLIMPORT marker from __pg_log_level
- 8d3341266508 15.0 landed
-
Mark a few 'bbsink' related functions / variables static.
- b5f44225b833 15.0 landed
-
Add some missing PGDLLIMPORT markings
- 5edeb574285e 15.0 landed
-
Apply PGDLLIMPORT markings broadly.
- 8ec569479fc2 15.0 landed
-
Helper script to apply PGDLLIMPORT markings.
- 80900d469091 15.0 landed
-
Simplify declaring variables exported from libpgcommon and libpgport.
- e04a8059a74c 15.0 cited