cstore_fdw
cstore_fdw copied to clipboard
Won't build on Illumos
@ptribble ever see this one before?
[root@tommy-dd378711 ~/cstore_fdw]# make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -m64 -fPIC --std=c99 -I. -I./ -I/opt/postgresql/11.1/include/server -I/opt/postgresql/11.1/include/internal -c -o cstore_fdw.o cstore_fdw.c
In file included from /opt/postgresql/11.1/include/server/postgres.h:47:0,
from cstore_fdw.c:18:
/opt/postgresql/11.1/include/server/utils/elog.h:318:20: error: unknown type name 'sigjmp_buf'
extern PGDLLIMPORT sigjmp_buf *PG_exception_stack;
^
<builtin>: recipe for target 'cstore_fdw.o' failed
make: *** [cstore_fdw.o] Error 1
Adding
#define _XOPEN_SOURCE to cstore_fdw.c got me to:
[root@tommy-dd378711 ~/cstore_fdw]# make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -pipe -O2 -D_FORTIFY_SOURCE=2 -I/opt/local/include -I/opt/local/include/ncurses -DLDAP_DEPRECATED -I/usr/include -fPIC --std=c99 --save-temp -I. -I./ -I/opt/local/include/postgresql/server -I/opt/local/include/postgresql/internal -I/opt/local/include -I/opt/local/include/ncurses -DLDAP_DEPRECATED -I/usr/include -I/opt/local/include/libxml2 -I/opt/local/include -c -o cstore_fdw.o cstore_fdw.c
gcc: warning: -pipe ignored because -save-temps specified
In file included from /opt/local/include/postgresql/server/nodes/execnodes.h:20:0,
from /opt/local/include/postgresql/server/commands/copy.h:17,
from cstore_fdw.c:33:
/opt/local/include/postgresql/server/executor/instrument.h:31:13: error: field 'blk_read_time' has incomplete type
instr_time blk_read_time; /* time spent reading */
^
/opt/local/include/postgresql/server/executor/instrument.h:32:13: error: field 'blk_write_time' has incomplete type
instr_time blk_write_time; /* time spent writing */
^
/opt/local/include/postgresql/server/executor/instrument.h:51:13: error: field 'starttime' has incomplete type
instr_time starttime; /* Start time of current iteration of node */
^
/opt/local/include/postgresql/server/executor/instrument.h:52:13: error: field 'counter' has incomplete type
instr_time counter; /* Accumulated runtime for this node */
^
<builtin>: recipe for target 'cstore_fdw.o' failed
make: *** [cstore_fdw.o] Error 1
Turned out you only need to add -D__EXTENSIONS__ to the Makefile. Could this be merged?
If you are building PostgreSQL from sources you can add it to CFLAGS when doing ./configure
Seem's relevant https://www.illumos.org/issues/6283