From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: r@pcorp.us
Subject: BUG #16920: Can't compile PostGIS with MingW64 against PostgreSQL 14 head
Date: Thu, 11 Mar 2021 04:47:19 +0000
Message-ID: <16920-2332590daf58407c@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 16920
Logged by: Regina Obe
Email address: r@pcorp.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.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, r@pcorp.us
Subject: Re: BUG #16920: Can't compile PostGIS with MingW64 against PostgreSQL 14 head
In-Reply-To: <16920-2332590daf58407c@postgresql.org>
* 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