BUG #16920: Can't compile PostGIS with MingW64 against PostgreSQL 14 head

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: r(at)pcorp(dot)us
Subject: BUG #16920: Can't compile PostGIS with MingW64 against PostgreSQL 14 head
Date: 2021-03-11 04:47:19
Message-ID: 16920-2332590daf58407c@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16920
Logged by: Regina Obe
Email address: r(at)pcorp(dot)us
PostgreSQL version: Unsupported/Unknown
Operating system: Windows MINGW64
Description:

I pulled PostgreSQL 14 earlier today to troubleshoot an issue we were having
and discovered I can not compile PostGIS with Mingw64 against PostgreSQL 14
head.

Issue detailed here - https://trac.osgeo.org/postgis/ticket/4877

It seems struct stat and friends were introduced in
include/server/port/win32_port.h.

NG64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32
-DWIN32_STACK_RLIMIT=4194304
-c -o lwgeom_in_gml.o lwgeom_in_gml.c
In file included from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port.h:26,
from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/c.h:1355,
from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/postgres.h:4

6,
from lwgeom_in_gml.c:55:
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:57:14:
warning:
'struct microsoft_native_stat' declared inside
parameter list will not be visible outside of
this definition
or declaration
#define stat microsoft_native_stat
^~~~~~~~~~~~~~~~~~~~~
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:57:14:
warning:
'struct microsoft_native_stat' declared inside
parameter list will not be visible outside of
this definition
or declaration
#define stat microsoft_native_stat
^~~~~~~~~~~~~~~~~~~~~
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:57:14:
warning:
'struct microsoft_native_stat' declared inside
parameter list will not be visible outside of
this definition
or declaration
#define stat microsoft_native_stat
^~~~~~~~~~~~~~~~~~~~~
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:57:14:
warning:
'struct microsoft_native_stat' declared inside
parameter list will not be visible outside of
this definition
or declaration
#define stat microsoft_native_stat
^~~~~~~~~~~~~~~~~~~~~
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:56:15:
error: co
nflicting types for 'microsoft_native_fstat'
#define fstat microsoft_native_fstat
^~~~~~~~~~~~~~~~~~~~~~
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:56:15:
note: pre
vious declaration of 'microsoft_native_fstat' was
here
#define fstat microsoft_native_fstat
^~~~~~~~~~~~~~~~~~~~~~
In file included from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_p

ort.h:58,
from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port.h:26,
from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/c.h:1355,
from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/postgres.h:4

6,
from lwgeom_in_gml.c:55:
C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/sys/stat.h: In function
'microsoft_native_
fstat':
C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/sys/stat.h:226:27: error:
invalid applicat
ion of 'sizeof' to incomplete type 'struct
microsoft_native_stat'
memset(_Stat,0,sizeof(struct stat));
^~~~~~
C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/sys/stat.h:231:8: error:
dereferencing poi
nter to incomplete type 'struct
microsoft_native_stat'
_Stat->st_dev=st.st_dev;
^~
In file included from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port.h:26,
from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/c.h:1355,
from
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/postgres.h:4

6,
from lwgeom_in_gml.c:55:
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:
At top level:
C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:256:8:
error: re
definition of 'struct stat'
struct stat /* This should match struct __stat64 */
^~~~
In file included from
C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/wchar.h:424,
from
C:/ming64gcc81/projects/rel-libiconv-1.15w64gcc81/include/iconv.h:110,
from
C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm

l2/libxml/encoding.h:28,
from
C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm

l2/libxml/parser.h:810,
from
C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm

l2/libxml/globals.h:18,
from
C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm

l2/libxml/threads.h:35,
from
C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm

l2/libxml/xmlmemory.h:218,
from
C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm

l2/libxml/tree.h:1307,
from lwgeom_in_gml.c:50:
C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/_mingw_stat64.h:43:10:
note: originally de
fined here
struct stat {
^~~~
make[1]: *** [<builtin>: lwgeom_in_gml.o] Error 1
make[1]: Leaving directory '/projects/postgis/postgis-git/postgis'
make: *** [GNUmakefile:22: all] Error 1

To work around the issue, I had to put in mingw64 guards since mingw64 gcc
8.1.0 I am using already has this.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message tomohiro hiramitsu 2021-03-11 05:10:39 Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.
Previous Message Tom Lane 2021-03-11 02:26:16 Re: BUG #16919: Unexpected precision loss in NUMERIC type during text cast, math operations