pgsql: Add central declarations for dlsym()ed symbols

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add central declarations for dlsym()ed symbols
Date: 2022-07-18 00:32:38
Message-ID: E1oDEgf-0001TQ-FA@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add central declarations for dlsym()ed symbols

This is in preparation for defaulting to -fvisibility=hidden in extensions,
instead of exporting all symbols. For that symbols intended to be exported
need to be tagged with PGDLLEXPORT. Most extensions only need to do so for
_PG_init() and functions defined with PG_FUNCTION_INFO_V1. Adding central
declarations avoids each extension having to add PGDLLEXPORT. Any existing
declarations in extensions will continue to work if fmgr.h is included before
them, otherwise compilation for Windows will fail.

Author: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-By: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/20211101020311.av6hphdl6xbjbuif@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f2b73c8d75d583adcdd3562adca335d31f430ac5

Modified Files
--------------
src/include/fmgr.h | 11 +++++++++++
src/include/jit/jit.h | 2 +-
src/include/postmaster/pgarch.h | 2 ++
src/include/replication/output_plugin.h | 2 ++
4 files changed, 16 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2022-07-18 01:05:56 pgsql: Default to hidden visibility for extension libraries where possi
Previous Message Tom Lane 2022-07-17 22:11:51 pgsql: postgres_fdw: be more wary about shippability of reg* constants.