Opened 10 years ago
Closed 6 years ago
#3037 closed defect (fixed)
Sort out CFLAGS differences in raster/rt_pg and liblwgeom/
Reported by: | strk | Owned by: | strk |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS Fund Me |
Component: | build | Version: | master |
Keywords: | Cc: |
Description
Looking at compiler warnings it came to my attention that some warnings are only output under raster/rt_pg. On a closer look, the compiler flags used there and in liblwgeom (for example) are different !
Here's the build line for raster/rt_pg/rtpostgis.c:
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -fpic -I/usr/local/include -I/usr/include/libxml2 -I/usr/local/include -DHAVE_SFCGAL "-I../../liblwgeom" -I/usr/local/include "-I../../libpgcommon" -I../rt_core -I. -I. -I/home/postgresql-9.3.4/include/server -I/home/postgresql-9.3.4/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o rtpostgis.o rtpostgis.c
And here's the one for liblwgeom/lwutil.c:
/bin/bash ../libtool --mode=compile gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -I/usr/local/include -I/usr/local/include -DHAVE_SFCGAL -c -o lwutil.lo lwutil.c libtool: compile: gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -I/usr/local/include -I/usr/local/include -DHAVE_SFCGAL -c lwutil.c -fPIC -DPIC -o .libs/lwutil.o
There's definitely something missing (warning flags, mostly) in liblwgeom.
Note that the liblwgeom issue is not libtool related as you can see from the build line for loader/shp2pgsql-core.c:
gcc -I ../liblwgeom -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c shp2pgsql-core.c
Change History (7)
comment:1 by , 9 years ago
Milestone: | PostGIS 2.2.0 → PostGIS Future |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Isn't this just an expected consequence of the pgsql modules (postgis/rt_postgis) inheriting their build info from pgxs while the core parts set their own flags (liblwgeom/rt_core)? Unless we read build flags from pg_config for all modules I don't see how we avoid some mismatching.
comment:6 by , 7 years ago
pramsey: it looks like you're right, this is a consequence of PGXS driving the flags ! Today for example, on a new system, I have different flags:
gcc "-I../../liblwgeom" -fPIC -I/usr/local/include -I/usr/include/libxml2 -I/usr/local/include "-I../../libpgcommon" -I../rt_core -I. -I./ -I/usr/include/postgresql/9.6/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o rtpg_create.o rtpg_create.c
I'm not sure what we want to do about this, if anything. Should we extract PGXS flags once from ./configure and use ours always?
comment:7 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This should be fixed with https://trac.osgeo.org/postgis/ticket/3995
there seem to be duplications in CFLAGS and CPPFLAGS, would be better to sort this one once for all