Re: Mark all GUC variable as PGDLLIMPORT

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chapman Flack <chap(at)anastigmatix(dot)net>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Mark all GUC variable as PGDLLIMPORT
Date: 2022-02-15 13:58:05
Message-ID: CA+TgmobHCj1BT_RkWWvhtgeiC+5TX8wViLPH-Zd2Ta3Z3c2WRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 14, 2022 at 8:53 PM Andres Freund <andres(at)anarazel(dot)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 Content-Type Size
v1-0001-Dumb-script-to-apply-PGDLLIMPORT-markings.patch application/octet-stream 1.7 KB
v1-0002-Plaster-PGDLLIMPORT-declarations-on-header-files.patch application/octet-stream 81.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2022-02-15 14:10:25 Re: Observability in Postgres
Previous Message Laurenz Albe 2022-02-15 13:55:49 Re: [PATCH] Add reloption for views to enable RLS