Re: PostgreSQL 9.4 InterlockedCompareExchange appearing in mingw64-w32 causing issue with PostGIS win32 load

From: "Paragon Corporation" <lr(at)pcorp(dot)us>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL 9.4 InterlockedCompareExchange appearing in mingw64-w32 causing issue with PostGIS win32 load
Date: 2014-05-22 17:16:24
Message-ID: 9AFCC7DC636740E294BB693C2E5D4FA0@O
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> Hm. s_lock.h does define TAS() in terms of InterlockedCompareExchange()
if WIN32_ONLY_COMPILER is defined ... but that code hasn't changed in quite
a long time. It
> seems like the combination of an extension built with WIN32_ONLY_COMPILER
and a core built without that flag should never have worked, if the core is
what has to link
> in InterlockedCompareExchange.

> I wonder if there is something you're doing that results in inlining a
spinlock call given the 9.4 headers, but did not previously. Can you narrow
down what part of
> your code is giving rise to the undefined reference?

> regards, tom lane

Tom,

Does it with all extensions, not just PostGIS (before I could swap between
say for example hstore mingw compiled and VC compiled and had no issue).
The Load function as you guessed shows in the extension .dll postgres.exe
reference but not clear where to tell where that is coming thru.

I'm compiling PostgreSQL the same way in both 9.3 and 9.4:

With something that looks like this:
export MINGHOST=i686-w64-mingw32
PG_VER=9.4

./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
--build=${MINGHOST} \
--with-pgport=8443 --disable-float8-byval --enable-cassert
--enable-debug \
--enable-integer-datetimes --without-zlib

With just the PG_VER being different.

What I did notice is that in 9.3, the config.log shows this for

9.4:
LDFLAGS=-Wl,--allow-multiple-definition -Wl,--disable-auto-import
-Wl,--as-needed

and
9.3:
LDFLAGS=-Wl,--allow-multiple-definition -Wl,--as-needed

You know what would cause those to change between versions?

I thought maybe the --disable-auto-import was doing something.

I'm trying to override the flag now to see if it makes a difference, but
having difficulty changing what I am seeing in the config.log

When I do any of the below:
export LDFLAGS=-Wl,--allow-multiple-definition -Wl,--enable-auto-import
-Wl,--as-needed
export LDFLAGS="-Wl,--allow-multiple-definition -Wl,--enable-auto-import
-Wl,--as-needed"
export LDFLAGS=-Wl,--allow-multiple-definition -Wl,--as-needed

Thanks,
Regina

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matteo Beccati 2014-05-22 19:55:51 Re: uuid-ossp (Re: [pgsql-packagers] Postgresapp 9.4 beta build ready)
Previous Message Jeff Ross 2014-05-22 15:20:38 Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 -> 9.3