Re: Mark all GUC variable as PGDLLIMPORT

From: Andres Freund <andres(at)anarazel(dot)de>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Mark all GUC variable as PGDLLIMPORT
Date: 2022-02-13 03:59:56
Message-ID: 20220213035956.bi6xumusrcog5wsb@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-02-13 04:12:42 Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set
Previous Message Andres Freund 2022-02-13 03:51:50 Re: Fix overflow in DecodeInterval