narwhal and PGDLLIMPORT

Started by Tom Laneabout 12 years ago204 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

I happened to notice today that the owner of buildfarm member narwhal
is trying to revive it after a long time offline, but it's failing in
the 9.3 branch (and not attempting to build HEAD, yet). The cause
appears to be that contrib/postgres_fdw is referencing the DateStyle
and IntervalStyle variables, which aren't marked PGDLLIMPORT.
Hm, well, that would be an easy change ... but that code was committed
last March. How is it that we didn't notice this long ago?

What this seems to indicate is that narwhal is the only buildfarm
animal that has a need for PGDLLIMPORT marks on global variables that
are referenced by extensions. Furthermore, nobody has attempted to
build 9.3 on a platform that needs that (or at least they've not
reported failure to us).

According to the buildfarm database, narwhal is running a gcc build on
Windows 2003. That hardly seems like a mainstream use case. I could
believe that it might be of interest to developers, but clearly no
developers are actually running such a build.

I think we should give serious consideration to desupporting this
combination so that we can get rid of the plague of PGDLLIMPORT
marks. Obviously this would depend on confirming that there are
no more-interesting Windows build methods that require it --- but
if there are any, I'd sure demand that there be an active buildfarm
instance to keep us from breaking the case again in future.

Thoughts?

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

#2Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#1)
Re: narwhal and PGDLLIMPORT

On 2014-02-01 20:03:58 -0500, Tom Lane wrote:

I think we should give serious consideration to desupporting this
combination so that we can get rid of the plague of PGDLLIMPORT
marks. Obviously this would depend on confirming that there are
no more-interesting Windows build methods that require it --- but
if there are any, I'd sure demand that there be an active buildfarm
instance to keep us from breaking the case again in future.

Weren't there more recent cases of needing to add PGDLLIMPORTs? I
certainly remember pushing code to Craig's jenkins instance which made
me do so for recent msvc
builds... E.g. 7d7eee8bb702d7796a0d7c5886c1f4685f2e2806 and
708c529c7fdeba9387825d746752fc6f439d781e just a few days ago seems to be
some of those cases.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#1)
Re: narwhal and PGDLLIMPORT

On 02/01/2014 08:03 PM, Tom Lane wrote:

I happened to notice today that the owner of buildfarm member narwhal
is trying to revive it after a long time offline, but it's failing in
the 9.3 branch (and not attempting to build HEAD, yet). The cause
appears to be that contrib/postgres_fdw is referencing the DateStyle
and IntervalStyle variables, which aren't marked PGDLLIMPORT.
Hm, well, that would be an easy change ... but that code was committed
last March. How is it that we didn't notice this long ago?

What this seems to indicate is that narwhal is the only buildfarm
animal that has a need for PGDLLIMPORT marks on global variables that
are referenced by extensions. Furthermore, nobody has attempted to
build 9.3 on a platform that needs that (or at least they've not
reported failure to us).

According to the buildfarm database, narwhal is running a gcc build on
Windows 2003. That hardly seems like a mainstream use case. I could
believe that it might be of interest to developers, but clearly no
developers are actually running such a build.

I think we should give serious consideration to desupporting this
combination so that we can get rid of the plague of PGDLLIMPORT
marks. Obviously this would depend on confirming that there are
no more-interesting Windows build methods that require it --- but
if there are any, I'd sure demand that there be an active buildfarm
instance to keep us from breaking the case again in future.

Thoughts?

I don't think that it's Windows 2003 that matters so much here as the
fact that it's a very old version of gcc. For example, my fairly old
buildfarm animal frogmouth, which will be decommissioned soon when
WindowsNT is totally unsupported, runs gcc 4.5.0, whereas narwhal runs
3.4.2. If anyone is really using such an old version, I think they
should stop, immediately.

cheers

andrew

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

#4Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#2)
Re: narwhal and PGDLLIMPORT

On 2014-02-02 02:15:39 +0100, Andres Freund wrote:

On 2014-02-01 20:03:58 -0500, Tom Lane wrote:

I think we should give serious consideration to desupporting this
combination so that we can get rid of the plague of PGDLLIMPORT
marks. Obviously this would depend on confirming that there are
no more-interesting Windows build methods that require it --- but
if there are any, I'd sure demand that there be an active buildfarm
instance to keep us from breaking the case again in future.

Weren't there more recent cases of needing to add PGDLLIMPORTs? I
certainly remember pushing code to Craig's jenkins instance which made
me do so for recent msvc
builds... E.g. 7d7eee8bb702d7796a0d7c5886c1f4685f2e2806 and
708c529c7fdeba9387825d746752fc6f439d781e just a few days ago seems to be
some of those cases.

And indeed, currawong failed with a link time error:
http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=currawong&dt=2014-01-17%2013%3A30%3A21

I don't know why it didn't fail for postgres_fdw. Hm, maybe it's because
Mkvcbuild.pm links postgres_fdw with libpq, but not test_shm_mq?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#2)
Re: narwhal and PGDLLIMPORT

Andres Freund <andres@2ndquadrant.com> writes:

On 2014-02-01 20:03:58 -0500, Tom Lane wrote:

I think we should give serious consideration to desupporting this
combination so that we can get rid of the plague of PGDLLIMPORT
marks. Obviously this would depend on confirming that there are
no more-interesting Windows build methods that require it --- but
if there are any, I'd sure demand that there be an active buildfarm
instance to keep us from breaking the case again in future.

Weren't there more recent cases of needing to add PGDLLIMPORTs?

Yeah, which makes the plot even thicker. If references to those
variables failed, how did we not notice postgres_fdw's issue?

I don't claim to know exactly what's going on, but I think we need
to find out.

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

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#4)
Re: narwhal and PGDLLIMPORT

Andres Freund <andres@2ndquadrant.com> writes:

I don't know why it didn't fail for postgres_fdw. Hm, maybe it's because
Mkvcbuild.pm links postgres_fdw with libpq, but not test_shm_mq?

Hard to see how libpq as such could have anything to do with it.
I wonder though if adding libpq causes some different link-time
switch to be used. If so, could we arrange to use that switch
all the time, and thus get rid of the need for PGDLLIMPORT marks?

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

#7Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#6)
Re: narwhal and PGDLLIMPORT

On 2014-02-01 21:04:44 -0500, Tom Lane wrote:

Andres Freund <andres@2ndquadrant.com> writes:

I don't know why it didn't fail for postgres_fdw. Hm, maybe it's because
Mkvcbuild.pm links postgres_fdw with libpq, but not test_shm_mq?

Hard to see how libpq as such could have anything to do with it.
I wonder though if adding libpq causes some different link-time
switch to be used. If so, could we arrange to use that switch
all the time, and thus get rid of the need for PGDLLIMPORT marks?

Well, not because of libpq itself, but because it causes a def file to
be used. I am not sure how they are autogenerated, but it might already
cause. I fortunately have forgotten most of that uglyness.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#8Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#1)
Re: narwhal and PGDLLIMPORT

On Sun, Feb 2, 2014 at 1:03 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I happened to notice today that the owner of buildfarm member narwhal
is trying to revive it after a long time offline, but it's failing in
the 9.3 branch (and not attempting to build HEAD, yet). The cause
appears to be that contrib/postgres_fdw is referencing the DateStyle
and IntervalStyle variables, which aren't marked PGDLLIMPORT.
Hm, well, that would be an easy change ... but that code was committed
last March. How is it that we didn't notice this long ago?

What this seems to indicate is that narwhal is the only buildfarm
animal that has a need for PGDLLIMPORT marks on global variables that
are referenced by extensions. Furthermore, nobody has attempted to
build 9.3 on a platform that needs that (or at least they've not
reported failure to us).

According to the buildfarm database, narwhal is running a gcc build on
Windows 2003. That hardly seems like a mainstream use case. I could
believe that it might be of interest to developers, but clearly no
developers are actually running such a build.

I think we should give serious consideration to desupporting this
combination so that we can get rid of the plague of PGDLLIMPORT
marks. Obviously this would depend on confirming that there are
no more-interesting Windows build methods that require it --- but
if there are any, I'd sure demand that there be an active buildfarm
instance to keep us from breaking the case again in future.

No objection here - though I should point out that it's not been
offline for a long time (aside from a couple of weeks in January) -
it's been happily building most pre-9.2 branches for ages. 9.1 seems
to be stuck, along with HEAD, and I forgot to add 9.3. I'm in the
process of cleaning that up as time allows, but am happy to drop it
instead if we no longer want to support anything that old. We
certainly don't use anything resembling that config for the EDB
installer builds.

I'm happy to replace it with something newer as time allows - what do
we consider to be the biggest gap? I have an MSDN subscription, so can
do any versions of Windows or VC++ (and obviously Mingw).

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dave Page (#8)
Re: narwhal and PGDLLIMPORT

Dave Page <dpage@pgadmin.org> writes:

On Sun, Feb 2, 2014 at 1:03 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I think we should give serious consideration to desupporting this
combination so that we can get rid of the plague of PGDLLIMPORT
marks.

No objection here - though I should point out that it's not been
offline for a long time (aside from a couple of weeks in January) -
it's been happily building most pre-9.2 branches for ages. 9.1 seems
to be stuck, along with HEAD, and I forgot to add 9.3. I'm in the
process of cleaning that up as time allows, but am happy to drop it
instead if we no longer want to support anything that old. We
certainly don't use anything resembling that config for the EDB
installer builds.

Further discussion pointed out that currawong, for example, seems to
want PGDLLIMPORT markings but is able to get by without them in
some cases that narwhal evidently doesn't like. So at this point,
desupporting narwhal's configuration is clearly premature --- we
should instead be looking into exactly what is causing the different
cases to fail or not fail.

I still have hopes that we might be able to get rid of PGDLLIMPORT
marks, but by actually understanding why they seem to be needed in
some cases and not others, not by just arbitrarily dropping support.

In the meantime, please do get HEAD running again on that machine.

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

#10Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#1)
Re: narwhal and PGDLLIMPORT

On 02/02/2014 09:03 AM, Tom Lane wrote:

According to the buildfarm database, narwhal is running a gcc build on
Windows 2003. That hardly seems like a mainstream use case. I could
believe that it might be of interest to developers, but clearly no
developers are actually running such a build.

I think we should give serious consideration to desupporting this
combination

I'm not a fan of MinGW (gcc) on Windows, it's a right pain. It's also
the only open source compiler currently supported for PostgreSQL on
Windows - practically the only one available. I don't know about you,
but I'm not too keen on assuming Microsoft will continue to offer free
toolchains that're usable for our purposes. They're crippling their free
build tools more and more with each release, which isn't a good trend.

If you wish to eliminate PGDLLIMPORT from the codebase the correct
approach would be building with --export-all-symbols (a MinGW extension
flag to gcc). That would make the MinGW builds consistent with the MSVC
build, which generates a .def file that exports all symbols.

As for why PGDLLIMPORT appears to be required in some places on the MSVC
build, so far it's looking like we auto-export functions, but not
necessarily variables. I'd need to read the fairly scary MSVC build
genreator scripts in detail to confirm that, to see how they produce
their DEF files; that'll have to wait until after I've got the
row-security work sorted out.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#11Ashesh Vashi
ashesh.vashi@enterprisedb.com
In reply to: Craig Ringer (#10)
Re: narwhal and PGDLLIMPORT

On Mon, Feb 3, 2014 at 6:52 AM, Craig Ringer <craig@2ndquadrant.com> wrote:

On 02/02/2014 09:03 AM, Tom Lane wrote:

According to the buildfarm database, narwhal is running a gcc build on
Windows 2003. That hardly seems like a mainstream use case. I could
believe that it might be of interest to developers, but clearly no
developers are actually running such a build.

I think we should give serious consideration to desupporting this
combination

I'm not a fan of MinGW (gcc) on Windows, it's a right pain. It's also
the only open source compiler currently supported for PostgreSQL on
Windows - practically the only one available. I don't know about you,
but I'm not too keen on assuming Microsoft will continue to offer free
toolchains that're usable for our purposes. They're crippling their free
build tools more and more with each release, which isn't a good trend.

If you wish to eliminate PGDLLIMPORT from the codebase the correct
approach would be building with --export-all-symbols (a MinGW extension
flag to gcc). That would make the MinGW builds consistent with the MSVC
build, which generates a .def file that exports all symbols.

As for why PGDLLIMPORT appears to be required in some places on the MSVC
build, so far it's looking like we auto-export functions, but not
necessarily variables.

In my experience, that is true.
During some contrib module development, while accessing a postgresql
variable
it was crashing on windows, while same was accessible in non-windows
platform.

I'd need to read the fairly scary MSVC build
genreator scripts in detail to confirm that, to see how they produce
their DEF files; that'll have to wait until after I've got the
row-security work sorted out.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

--
--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company<http://www.enterprisedb.com&gt;

*http://www.linkedin.com/in/asheshvashi*&lt;http://www.linkedin.com/in/asheshvashi&gt;

#12Craig Ringer
craig@2ndquadrant.com
In reply to: Ashesh Vashi (#11)
Re: narwhal and PGDLLIMPORT

On 02/03/2014 11:10 AM, Ashesh Vashi wrote:

On Mon, Feb 3, 2014 at 6:52 AM, Craig Ringer <craig@2ndquadrant.com
<mailto:craig@2ndquadrant.com>> wrote:

On 02/02/2014 09:03 AM, Tom Lane wrote:

According to the buildfarm database, narwhal is running a gcc build on
Windows 2003. That hardly seems like a mainstream use case. I could
believe that it might be of interest to developers, but clearly no
developers are actually running such a build.

I think we should give serious consideration to desupporting this
combination

I'm not a fan of MinGW (gcc) on Windows, it's a right pain. It's also
the only open source compiler currently supported for PostgreSQL on
Windows - practically the only one available. I don't know about you,
but I'm not too keen on assuming Microsoft will continue to offer free
toolchains that're usable for our purposes. They're crippling their free
build tools more and more with each release, which isn't a good trend.

If you wish to eliminate PGDLLIMPORT from the codebase the correct
approach would be building with --export-all-symbols (a MinGW extension
flag to gcc). That would make the MinGW builds consistent with the MSVC
build, which generates a .def file that exports all symbols.

As for why PGDLLIMPORT appears to be required in some places on the MSVC
build, so far it's looking like we auto-export functions, but not
necessarily variables.

In my experience, that is true.
During some contrib module development, while accessing a postgresql
variable
it was crashing on windows, while same was accessible in non-windows
platform.

I think it's a good thing personally - we shouldn't be exporting every
little internal var in the symbol table.

If we built with -fvisibility=hidden on 'nix there'd be no need to
complain about commits being on on 'nix then breaking on Windows, 'cos
the 'nix build would break in the same place. That's all or nothing
though, there's no "vars hidden, procs exported" option in gcc.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#13Amit Kapila
amit.kapila16@gmail.com
In reply to: Craig Ringer (#10)
Re: narwhal and PGDLLIMPORT

On Mon, Feb 3, 2014 at 6:52 AM, Craig Ringer <craig@2ndquadrant.com> wrote:

On 02/02/2014 09:03 AM, Tom Lane wrote:

According to the buildfarm database, narwhal is running a gcc build on
Windows 2003. That hardly seems like a mainstream use case. I could
believe that it might be of interest to developers, but clearly no
developers are actually running such a build.

I think we should give serious consideration to desupporting this
combination

I'm not a fan of MinGW (gcc) on Windows, it's a right pain. It's also
the only open source compiler currently supported for PostgreSQL on
Windows - practically the only one available. I don't know about you,
but I'm not too keen on assuming Microsoft will continue to offer free
toolchains that're usable for our purposes. They're crippling their free
build tools more and more with each release, which isn't a good trend.

If you wish to eliminate PGDLLIMPORT from the codebase the correct
approach would be building with --export-all-symbols (a MinGW extension
flag to gcc). That would make the MinGW builds consistent with the MSVC
build, which generates a .def file that exports all symbols.

As for why PGDLLIMPORT appears to be required in some places on the MSVC
build, so far it's looking like we auto-export functions, but not
necessarily variables.

I could see both the variables (DateStyle and IntervalStyle) currently Tom
points out in both .def file and by using dumpbin utility.
I think these symbols are exported, the main reason of failure is that they
are not imported in postres_fdw as we have not used PGDLLIMPORT.

Looking at below code, as per my understanding for contrib modules
BUILDING_DLL is not defined and by using PGDLLIMPORT, it
can lead to import of the required variables.

#ifdef BUILDING_DLL
#define PGDLLIMPORT __declspec (dllexport)
#else /* not BUILDING_DLL */
#define PGDLLIMPORT __declspec (dllimport)
#endif

We need this for variables, but they are optional for functions. Please refer
below link:
http://msdn.microsoft.com/en-us/library/8fskxacy(v=vs.80).aspx

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

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

#14Amit Kapila
amit.kapila16@gmail.com
In reply to: Tom Lane (#1)
Re: narwhal and PGDLLIMPORT

On Sun, Feb 2, 2014 at 6:33 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I happened to notice today that the owner of buildfarm member narwhal
is trying to revive it after a long time offline, but it's failing in
the 9.3 branch (and not attempting to build HEAD, yet). The cause
appears to be that contrib/postgres_fdw is referencing the DateStyle
and IntervalStyle variables, which aren't marked PGDLLIMPORT.
Hm, well, that would be an easy change ... but that code was committed
last March. How is it that we didn't notice this long ago?

What this seems to indicate is that narwhal is the only buildfarm
animal that has a need for PGDLLIMPORT marks on global variables that
are referenced by extensions.

I have tried to debug the part of code where we are using DateStyle and
IntervalStyle variables in postgres_fdw on my m/c
(Win 7 - 64 bit, MSVC2010) and found that there value is junk, to me the
problem looks exactly similar to what we have seen for test_shm_mq
modules few days back. I am not sure why it is passing on other
buildfarm m/c, but I think we need to put PGDLLIMPORT for global
variables we want to use in extensions.
Also as per below link, it seems that PGDLLIMPORT is required for
exported global variables.
http://msdn.microsoft.com/en-us/library/8fskxacy(v=vs.80).aspx

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

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

#15Tom Lane
tgl@sss.pgh.pa.us
In reply to: Amit Kapila (#14)
Re: narwhal and PGDLLIMPORT

Amit Kapila <amit.kapila16@gmail.com> writes:

Also as per below link, it seems that PGDLLIMPORT is required for
exported global variables.
http://msdn.microsoft.com/en-us/library/8fskxacy(v=vs.80).aspx

That was what we'd always assumed, but the fact that postgres_fdw has been
working for the last year (on everything except narwhal) puts the lie to
that as a blanket assumption.

So what I want to know now is how come it wasn't failing; because then
we might be able to exploit that to eliminate the need for the PGDLLIMPORT
cruft everywhere. I've never been a fan of the fact that Windows insists
on its own private set of global symbol visibility rules. If we can make
that build work more like other platforms, it'll be a step forward IMO.

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

In reply to: Craig Ringer (#10)
Re: narwhal and PGDLLIMPORT

On Sun, Feb 2, 2014 at 5:22 PM, Craig Ringer <craig@2ndquadrant.com> wrote:

I'm not a fan of MinGW (gcc) on Windows, it's a right pain. It's also
the only open source compiler currently supported for PostgreSQL on
Windows - practically the only one available. I don't know about you,
but I'm not too keen on assuming Microsoft will continue to offer free
toolchains that're usable for our purposes. They're crippling their free
build tools more and more with each release, which isn't a good trend.

I was under the impression that Microsoft had finally come around to
implementing a few C99 features in Visual Studio 2013 precisely
because they want there to be an open source ecosystem on Windows.

--
Peter Geoghegan

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

#17Andres Freund
andres@anarazel.de
In reply to: Craig Ringer (#12)
Re: narwhal and PGDLLIMPORT

On 2014-02-03 12:00:40 +0800, Craig Ringer wrote:

I think it's a good thing personally - we shouldn't be exporting every
little internal var in the symbol table.

If we built with -fvisibility=hidden on 'nix there'd be no need to
complain about commits being on on 'nix then breaking on Windows, 'cos
the 'nix build would break in the same place. That's all or nothing
though, there's no "vars hidden, procs exported" option in gcc.

I think that'd be an exercise in futility. We're not talking about a
general purpose library here, where I agree -fvisibility=hidden is a
useful thing, but about the backend. We'd break countless extensions
people have written. Most of those have been authored on *nix.
To make any form of sense we'd need to have a really separate API
layer between internal/external stuff. That doesn't seem likely to
arrive anytime soon, if ever.
I think all that would achieve is that we'd regularly need to backpatch
visibility fixes. And have countless pointless flames about which
variables to expose.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#18Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#9)
Re: narwhal and PGDLLIMPORT

On Sun, Feb 2, 2014 at 3:59 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Dave Page <dpage@pgadmin.org> writes:

On Sun, Feb 2, 2014 at 1:03 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I think we should give serious consideration to desupporting this
combination so that we can get rid of the plague of PGDLLIMPORT
marks.

No objection here - though I should point out that it's not been
offline for a long time (aside from a couple of weeks in January) -
it's been happily building most pre-9.2 branches for ages. 9.1 seems
to be stuck, along with HEAD, and I forgot to add 9.3. I'm in the
process of cleaning that up as time allows, but am happy to drop it
instead if we no longer want to support anything that old. We
certainly don't use anything resembling that config for the EDB
installer builds.

Further discussion pointed out that currawong, for example, seems to
want PGDLLIMPORT markings but is able to get by without them in
some cases that narwhal evidently doesn't like. So at this point,
desupporting narwhal's configuration is clearly premature --- we
should instead be looking into exactly what is causing the different
cases to fail or not fail.

I still have hopes that we might be able to get rid of PGDLLIMPORT
marks, but by actually understanding why they seem to be needed in
some cases and not others, not by just arbitrarily dropping support.

In the meantime, please do get HEAD running again on that machine.

Done: http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=narwhal&amp;dt=2014-02-03%2009%3A26%3A43

It's not happy though :-(

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

#19Robert Haas
robertmhaas@gmail.com
In reply to: Dave Page (#18)
Re: narwhal and PGDLLIMPORT

On Mon, Feb 3, 2014 at 5:45 AM, Dave Page <dpage@pgadmin.org> wrote:

Done: http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=narwhal&amp;dt=2014-02-03%2009%3A26%3A43

It's not happy though :-(

Specifically, it says:

dlltool --export-all --output-def libpg_buffercachedll.def
pg_buffercache_pages.o
dllwrap -o pg_buffercache.dll --dllname pg_buffercache.dll --def
libpg_buffercachedll.def pg_buffercache_pages.o -L../../src/port
-L../../src/common -Wl,--allow-multiple-definition -L/mingw/lib
-Wl,--as-needed -L../../src/backend -lpostgres
Info: resolving _MainLWLockArray by linking to __imp__MainLWLockArray
(auto-import)
fu000001.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
fu000002.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
nmth000000.o(.idata$4+0x0): undefined reference to `_nm__MainLWLockArray'

I assume I should go stick a DLLIMPORT on MainLWLockArray, unless
somebody has another proposal.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

#20Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#19)
Re: narwhal and PGDLLIMPORT

Robert Haas <robertmhaas@gmail.com> writes:

I assume I should go stick a DLLIMPORT on MainLWLockArray, unless
somebody has another proposal.

Hold up awhile. The reason we're resurrecting it is to get a crosscheck
on what symbols it thinks need DLLIMPORT that no other platform does.

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

#21Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#17)
#22Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#21)
#23Craig Ringer
craig@2ndquadrant.com
In reply to: Andres Freund (#17)
#24Andres Freund
andres@anarazel.de
In reply to: Craig Ringer (#23)
#25Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#22)
#26Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#25)
#27Andrew Dunstan
andrew@dunslane.net
In reply to: Peter Geoghegan (#16)
#28Robert Haas
robertmhaas@gmail.com
In reply to: Andrew Dunstan (#27)
#29Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#27)
#30Amit Kapila
amit.kapila16@gmail.com
In reply to: Tom Lane (#15)
#31Tom Lane
tgl@sss.pgh.pa.us
In reply to: Amit Kapila (#30)
#32Amit Kapila
amit.kapila16@gmail.com
In reply to: Tom Lane (#31)
#33Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#31)
#34Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#33)
#35Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#34)
#36Andres Freund
andres@anarazel.de
In reply to: Andrew Dunstan (#35)
#37Andrew Dunstan
andrew@dunslane.net
In reply to: Andres Freund (#36)
#38Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#37)
#39Joshua D. Drake
jd@commandprompt.com
In reply to: Tom Lane (#38)
#40Jeff Janes
jeff.janes@gmail.com
In reply to: Andrew Dunstan (#35)
#41Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joshua D. Drake (#39)
#42Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#41)
#43Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Tom Lane (#41)
#44Joshua D. Drake
jd@commandprompt.com
In reply to: Andrew Dunstan (#42)
#45Jeff Janes
jeff.janes@gmail.com
In reply to: Andrew Dunstan (#37)
#46Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#38)
#47Andrew Dunstan
andrew@dunslane.net
In reply to: Jeff Janes (#45)
#48Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#46)
#49Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#47)
#50Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#49)
#51Craig Ringer
craig@2ndquadrant.com
In reply to: Jeff Janes (#45)
#52Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#41)
#53Andrew Dunstan
andrew@dunslane.net
In reply to: Craig Ringer (#51)
#54Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#48)
#55Craig Ringer
craig@2ndquadrant.com
In reply to: Andrew Dunstan (#35)
#56Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#54)
#57Joshua D. Drake
jd@commandprompt.com
In reply to: Robert Haas (#28)
#58Andrew Dunstan
andrew@dunslane.net
In reply to: Joshua D. Drake (#57)
#59Joshua D. Drake
jd@commandprompt.com
In reply to: Andrew Dunstan (#58)
#60Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#56)
#61Craig Ringer
craig@2ndquadrant.com
In reply to: Craig Ringer (#60)
#62Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#56)
#63Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Hiroshi Inoue (#62)
#64Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#63)
#65Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#64)
#66Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#64)
#67Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#65)
#68Amit Kapila
amit.kapila16@gmail.com
In reply to: Tom Lane (#64)
#69Marco Atzeri
marco.atzeri@gmail.com
In reply to: Andrew Dunstan (#66)
#70Andrew Dunstan
andrew@dunslane.net
In reply to: Marco Atzeri (#69)
#71Marco Atzeri
marco.atzeri@gmail.com
In reply to: Andrew Dunstan (#70)
#72Tom Lane
tgl@sss.pgh.pa.us
In reply to: Amit Kapila (#68)
#73Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#56)
#74Amit Kapila
amit.kapila16@gmail.com
In reply to: Craig Ringer (#73)
#75Craig Ringer
craig@2ndquadrant.com
In reply to: Amit Kapila (#74)
#76Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Andrew Dunstan (#66)
#77Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Hiroshi Inoue (#76)
#78Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#77)
#79Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#78)
#80Amit Kapila
amit.kapila16@gmail.com
In reply to: Craig Ringer (#79)
#81Tom Lane
tgl@sss.pgh.pa.us
In reply to: Marco Atzeri (#71)
#82Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#76)
#83Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#73)
#84Marco Atzeri
marco.atzeri@gmail.com
In reply to: Tom Lane (#81)
#85Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#79)
#86Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#82)
#87Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#85)
#88Craig Ringer
craig@2ndquadrant.com
In reply to: Amit Kapila (#80)
#89Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#86)
#90Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#89)
#91Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#87)
#92Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#91)
#93Andrew Dunstan
andrew@dunslane.net
In reply to: Craig Ringer (#92)
#94Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#93)
#95Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#94)
#96Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#86)
#97Amit Kapila
amit.kapila16@gmail.com
In reply to: Craig Ringer (#88)
#98Magnus Hagander
magnus@hagander.net
In reply to: Craig Ringer (#95)
#99Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#82)
#100Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#87)
#101Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#100)
#102Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#101)
#103Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#102)
#104Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#103)
#105Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#104)
#106Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#104)
#107Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#105)
#108Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#107)
#109Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#108)
#110Marco Atzeri
marco.atzeri@gmail.com
In reply to: Tom Lane (#102)
#111Andres Freund
andres@anarazel.de
In reply to: Marco Atzeri (#110)
#112Marco Atzeri
marco.atzeri@gmail.com
In reply to: Andres Freund (#111)
#113Tom Lane
tgl@sss.pgh.pa.us
In reply to: Marco Atzeri (#112)
#114Peter Eisentraut
peter_e@gmx.net
In reply to: Craig Ringer (#89)
#115Andres Freund
andres@anarazel.de
In reply to: Peter Eisentraut (#114)
#116Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#115)
#117Peter Eisentraut
peter_e@gmx.net
In reply to: Andres Freund (#115)
#118Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#117)
#119Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#116)
#120Craig Ringer
craig@2ndquadrant.com
In reply to: Hiroshi Inoue (#99)
#121Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#104)
#122Craig Ringer
craig@2ndquadrant.com
In reply to: Peter Eisentraut (#114)
#123Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#120)
#124Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#116)
#125Craig Ringer
craig@2ndquadrant.com
In reply to: Peter Eisentraut (#117)
#126Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#125)
#127Andres Freund
andres@anarazel.de
In reply to: Craig Ringer (#125)
#128Craig Ringer
craig@2ndquadrant.com
In reply to: Andres Freund (#127)
#129Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Hiroshi Inoue (#96)
#130Marco Atzeri
marco.atzeri@gmail.com
In reply to: Craig Ringer (#121)
#131Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#123)
#132Craig Ringer
craig@2ndquadrant.com
In reply to: Marco Atzeri (#130)
#133Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Hiroshi Inoue (#129)
#134Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#133)
#135Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#86)
#136Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#135)
#137Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#136)
#138Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#137)
#139Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#138)
#140Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#139)
#141Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#113)
#142Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#141)
#143Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#142)
#144Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#143)
#145Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#144)
#146Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#145)
#147Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#146)
#148Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#147)
#149Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#148)
#150Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#148)
#151Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#150)
#152Marco Atzeri
marco.atzeri@gmail.com
In reply to: Tom Lane (#104)
#153Andres Freund
andres@anarazel.de
In reply to: Marco Atzeri (#152)
#154Marco Atzeri
marco.atzeri@gmail.com
In reply to: Andres Freund (#153)
#155Andres Freund
andres@anarazel.de
In reply to: Marco Atzeri (#154)
#156Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#155)
#157Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#156)
#158Marco Atzeri
marco.atzeri@gmail.com
In reply to: Andres Freund (#157)
#159Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#157)
#160Tom Lane
tgl@sss.pgh.pa.us
In reply to: Marco Atzeri (#158)
#161Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#160)
#162Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#161)
#163Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#162)
#164Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#137)
#165Craig Ringer
craig@2ndquadrant.com
In reply to: Andres Freund (#161)
#166Andres Freund
andres@anarazel.de
In reply to: Marco Atzeri (#154)
#167Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#164)
#168Marco Atzeri
marco.atzeri@gmail.com
In reply to: Andres Freund (#166)
#169Tom Lane
tgl@sss.pgh.pa.us
In reply to: Marco Atzeri (#168)
#170Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#169)
#171Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#170)
#172Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#171)
#173Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#137)
#174Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#1)
#175Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dave Page (#173)
#176Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#175)
#177Andres Freund
andres@anarazel.de
In reply to: Dave Page (#176)
#178Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#177)
#179Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#178)
#180Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#179)
#181Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Hiroshi Inoue (#99)
#182Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#181)
#183Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#181)
#184Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#183)
#185Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Tom Lane (#183)
#186Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Inoue (#185)
#187Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#186)
#188Hiroshi Inoue
Inoue@tpf.co.jp
In reply to: Dave Page (#176)
#189Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Hiroshi Inoue (#188)
#190Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#189)
#191Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#190)
#192Andrew Dunstan
andrew@dunslane.net
In reply to: Dave Page (#191)
#193Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dave Page (#191)
#194Noah Misch
noah@leadboat.com
In reply to: Tom Lane (#193)
#195Craig Ringer
craig@2ndquadrant.com
In reply to: Noah Misch (#194)
#196Andrew Dunstan
andrew@dunslane.net
In reply to: Craig Ringer (#195)
#197Noah Misch
noah@leadboat.com
In reply to: Noah Misch (#194)
#198Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noah Misch (#197)
#199Noah Misch
noah@leadboat.com
In reply to: Tom Lane (#198)
#200Andres Freund
andres@anarazel.de
In reply to: Noah Misch (#197)
#201Noah Misch
noah@leadboat.com
In reply to: Andres Freund (#200)
#202Noah Misch
noah@leadboat.com
In reply to: Noah Misch (#197)
#203Noah Misch
noah@leadboat.com
In reply to: Noah Misch (#202)
#204Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noah Misch (#203)