pramsey / pgsql-ogr-fdw

PostgreSQL foreign data wrapper for OGR
MIT License
239 stars 34 forks source link

PG11: No rule to make target 'stringbuffer_pg.bc', needed by 'all' #153

Closed df7cb closed 6 years ago

df7cb commented 6 years ago

pgsql-ogr-fdw fails to build with PG 11beta1 when JIT is enabled, i.e. PostgreSQL was configured --with-llvm:

09:13:29 /usr/include/gdal/cpl_config.h:284:9: warning: 'PACKAGE_VERSION' macro redefined [-Wmacro-redefined]
09:13:29 #define PACKAGE_VERSION ""
09:13:29         ^
09:13:29 /usr/include/postgresql/11/server/pg_config.h:788:9: note: previous definition is here
09:13:29 #define PACKAGE_VERSION "11beta1"
09:13:29         ^
09:13:29 5 warnings generated.
09:13:29 /usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2  -I/usr/include/gdal -I. -I/<<PKGBUILDDIR>> -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5 -flto=thin -emit-llvm -c -o ogr_fdw_common.bc /<<PKGBUILDDIR>>/ogr_fdw_common.c
09:13:30 make[2]: *** No rule to make target 'stringbuffer_pg.bc', needed by 'all'.  Stop.

The reason it is failing is because of this Makefile rule, which builds pg_stringbuffer_pg.o from pg_stringbuffer.c - note the missing _pg part:

OBJS = ogr_fdw.o ogr_fdw_deparse.o ogr_fdw_common.o stringbuffer_pg.o

stringbuffer_pg.o: stringbuffer.c stringbuffer.h
        $(CC) $(CFLAGS) -D USE_PG_MEM -c -o $@ $<

This might as well be a PGXS bug - I'll open a thread on pgsql-hacker for discussion: https://www.postgresql.org/message-id/20180528074432.GB22299%40msg.df7cb.de

devrimgunduz commented 6 years ago

I'm also getting these on my Fedora 28 box (gcc 8.1.1).

/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I/usr/include/gdal -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o ogr_fdw_common.bc ogr_fdw_common.c make[1]: No rule to make target 'stringbuffer_pg.bc', needed by 'all'. Stop. make[1]: Waiting for unfinished jobs.... stringbuffer.c: In function 'stringbuffer_avprintf': stringbuffer.c:220:2: warning: function 'stringbuffer_avprintf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] len = vsnprintf(s->str_end, maxlen, fmt, ap2); ^~~ stringbuffer.c:240:3: warning: function 'stringbuffer_avprintf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] len = vsnprintf(s->str_end, maxlen, fmt, ap); ^~~ ogr_fdw_deparse.c: In function 'ogrDeparseNullTest': ogr_fdw_deparse.c:490:5: warning: this 'else' clause does not guard... [-Wmisleading-indentation] else ^~~~ ogr_fdw_deparse.c:493:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else' return true; ^~ ogr_fdw.c: In function 'ogrReadColumnData': ogr_fdw.c:1158:16: warning: implicit declaration of function 'get_relid_attribute_name'; did you mean 'get_rte_attribute_name'? [-Wimplicit-function-declaration] col.pgname = get_relid_attribute_name(rel->rd_id, att_tuple->attnum); ^~~~~~~~ get_rte_attribute_name ogr_fdw.c:1158:14: warning: assignment to 'char ' from 'int' makes pointer from integer without a cast [-Wint-conversion] col.pgname = get_relid_attribute_name(rel->rd_id, att_tuple->attnum); ^ ogr_fdw.c:1158:16: warning: implicit declaration of function 'get_relid_attribute_name' is invalid in C99 [-Wimplicit-function-declaration] col.pgname = get_relid_attribute_name(rel->rd_id, att_tuple->attnum); ^ ogr_fdw.c:1158:14: warning: incompatible integer to pointer conversion assigning to 'char ' from 'int' [-Wint-conversion] col.pgname = get_relid_attribute_name(rel->rd_id, att_tuple->attnum); ^ ~~~~~~~~~~~ 2 warnings generated. make[1]: Leaving directory '/home/devrim/Documents/Devrim/Projects/repo/pgrpms/rpm/redhat/master/ogr_fdw/master/pgsql-ogr-fdw-1.0.5' error: Bad exit status from /var/tmp/rpm-tmp.LvPh5Z (%build)