pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: pgsql-hackers@postgreSQL.org <pgsql-hackers@postgresql.org>
Subject: Re: Add PGDLLEXPORT to PG_FUNCTION_INFO_V1
Date: Wed, 12 Oct 2016 10:26:10 -0400
Message-ID: <10909.1476282370@sss.pgh.pa.us> (raw)
In-Reply-To: <A737B7A37273E048B164557ADEF4A58B5393033E@ntex2010a.host.magwien.gv.at>
References: <A737B7A37273E048B164557ADEF4A58B539300BD@ntex2010a.host.magwien.gv.at>
	<5586.1476276329@sss.pgh.pa.us>
	<A737B7A37273E048B164557ADEF4A58B53930279@ntex2010a.host.magwien.gv.at>
	<8027.1476279261@sss.pgh.pa.us>
	<A737B7A37273E048B164557ADEF4A58B5393033E@ntex2010a.host.magwien.gv.at>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Albe Laurenz <laurenz.albe@wien.gv.at> writes:
> Tom Lane wrote:
>> Except that we don't.  There aren't PGDLLEXPORT markings for any
>> functions exported from contrib modules, and we don't use dlltool
>> on them either.  By your argument, none of contrib would work on
>> Windows builds at all, but we have a ton of buildfarm evidence and
>> successful field use to the contrary.  How is that all working?

> I thought it was the job of src/tools/msvc/gendef.pl to generate
> .DEF files?

Hm, okay, so after further review and googling:

MSVC: gendef.pl is used to build a .DEF file, creating the equivalent
of --export-all-symbols behavior.

Mingw: we use handmade .DEF files for libpq and a few other libraries,
otherwise Makefile.shlib explicitly specifies -Wl,--export-all-symbols.

Cygwin: per https://sourceware.org/binutils/docs-2.17/ld/WIN32.html
--export-all-symbols is the default unless you use a .DEF file or have at
least one symbol marked __declspec(dllexport) --- but the Cygwin build
defines PGDLLEXPORT as empty, so there won't be any of the latter.

So it works for us, but the stackoverflow complainant is evidently using
some homebrew build process that does none of the above.

I'm okay with adding PGDLLEXPORT to the extern, but we should update
that comment to note that it's not necessary with any of our standard
Windows build processes.  (For that matter, the comment fails to explain
why this macro is providing an extern for the base function at all...)

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (35+ messages)  latest in thread

Message-ID: <10909.1476282370@sss.pgh.pa.us>
Permalink:  ../10909.1476282370@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10909.1476282370@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, laurenz.albe@wien.gv.at
  Subject: Re: Add PGDLLEXPORT to PG_FUNCTION_INFO_V1
  In-Reply-To: <10909.1476282370@sss.pgh.pa.us>
  References: <A737B7A37273E048B164557ADEF4A58B539300BD@ntex2010a.host.magwien.gv.at> <5586.1476276329@sss.pgh.pa.us> <A737B7A37273E048B164557ADEF4A58B53930279@ntex2010a.host.magwien.gv.at> <8027.1476279261@sss.pgh.pa.us> <A737B7A37273E048B164557ADEF4A58B5393033E@ntex2010a.host.magwien.gv.at> <10909.1476282370@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox