Re: Mark all GUC variable as PGDLLIMPORT - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Mark all GUC variable as PGDLLIMPORT
Date
Msg-id CA+TgmobHCj1BT_RkWWvhtgeiC+5TX8wViLPH-Zd2Ta3Z3c2WRQ@mail.gmail.com
Whole thread Raw
In response to Re: Mark all GUC variable as PGDLLIMPORT  (Andres Freund <andres@anarazel.de>)
Responses Re: Mark all GUC variable as PGDLLIMPORT  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Mon, Feb 14, 2022 at 8:53 PM Andres Freund <andres@anarazel.de> wrote:
> > An alternative rule which would dodge that particular issue would be
> > to just slap PGDLLIMPORT on every global variable in every header
> > file. That would arguably be a simpler rule, though it means even more
> > PGDLLIMPORT declarations floating around.
>
> That would have the advantage of being comparatively easy to check in an
> automated way. Might even be cheap enough to just make it part of the build.

I wasn't able to quickly write something that was smart enough to use
as part of the build, but I wrote something dumb that I think works
well enough to use with a little bit of human intelligence alongside.
See attached.

> But it seems like it'd be a fair amount of work and cause a lot of patch
> rebasing pain? If we end up going that way, we should schedule this to happen
> just after the feature freeze, I think.

We could do that. I'd sort of rather get it done. We still have two
weeks before the last CommitFest officially starts, and it's not as if
there won't be tons of uncommitted patches floating around after that.

> If we consider doing this for all extern variables, we should think about
> doing this for headers *and* functions. That'd allow us to get rid of the
> fairly complicated logic to generate the .def file for the postgres binary on
> windows (src/tools/gendef.pl). And maybe also the related thing on AIX
> (src/backend/port/aix/mkldexport.sh)

I don't know what you mean by this.

-- 
Robert Haas
EDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: OpenSSL conflicts with wincrypt.h
Next
From: Joe Conway
Date:
Subject: Re: Observability in Postgres