[postgis-tickets] r17607 - Add CPPFLAGS where missing

Raul raul at rmr.ninja
Tue Jul 16 01:58:21 PDT 2019


Author: algunenano
Date: 2019-07-16 01:58:20 -0700 (Tue, 16 Jul 2019)
New Revision: 17607

Modified:
   branches/2.4/libpgcommon/Makefile.in
   branches/2.4/loader/Makefile.in
   branches/2.4/raster/loader/Makefile.in
Log:
Add CPPFLAGS where missing

Spotted by Debian's build log hardening checker, blhc.

https://salsa.debian.org/debian-gis-team/postgis/-/jobs/222378

Patch by Christoph Berg <myon -at- debian.org>



Modified: branches/2.4/libpgcommon/Makefile.in
===================================================================
--- branches/2.4/libpgcommon/Makefile.in	2019-07-16 08:57:58 UTC (rev 17606)
+++ branches/2.4/libpgcommon/Makefile.in	2019-07-16 08:58:20 UTC (rev 17607)
@@ -57,8 +57,8 @@
 	$(MAKE) -C cunit check
 
 # Command to build each of the .o files
-$(SA_OBJS): %.o: %.c 
-	$(CC) $(CFLAGS) -c -o $@ $<
+$(SA_OBJS): %.o: %.c
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
 
 $(SA_OBJS): ../postgis_config.h
 

Modified: branches/2.4/loader/Makefile.in
===================================================================
--- branches/2.4/loader/Makefile.in	2019-07-16 08:57:58 UTC (rev 17606)
+++ branches/2.4/loader/Makefile.in	2019-07-16 08:58:20 UTC (rev 17607)
@@ -87,13 +87,13 @@
 	$(MAKE) -C ../liblwgeom
 
 shp2pgsql-core.o: shp2pgsql-core.c shp2pgsql-core.h shpcommon.h
-	$(CC) $(CFLAGS) -c $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
 
 pgsql2shp-core.o: pgsql2shp-core.c pgsql2shp-core.h shpcommon.h
-	$(CC) $(CFLAGS) $(PGSQL_FE_CPPFLAGS) -c $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(PGSQL_FE_CPPFLAGS) -c $<
 
 pgsql2shp-cli.o: pgsql2shp-cli.c pgsql2shp-core.h shpcommon.h
-	$(CC) $(CFLAGS) $(PGSQL_FE_CPPFLAGS) -c $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(PGSQL_FE_CPPFLAGS) -c $<
 
 $(PGSQL2SHP-CLI): $(SHPLIB_OBJS) pgsql2shp-core.o pgsql2shp-cli.o $(LIBLWGEOM)
 	$(LIBTOOL) --mode=link \
@@ -104,7 +104,7 @@
 	  $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(GETTEXT_LDFLAGS) $(ICONV_LDFLAGS)
 
 shp2pgsql-gui.o: shp2pgsql-gui.c shp2pgsql-core.h shpcommon.h
-	$(CC) $(CFLAGS) $(GTK_CFLAGS) $(PGSQL_FE_CPPFLAGS) -o $@ -c shp2pgsql-gui.c
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(GTK_CFLAGS) $(PGSQL_FE_CPPFLAGS) -o $@ -c shp2pgsql-gui.c
 
 $(SHP2PGSQL-GUI): $(SHPLIB_OBJS) shp2pgsql-core.o shp2pgsql-gui.o pgsql2shp-core.o $(LIBLWGEOM) $(GTK_WIN32_RES)
 	$(LIBTOOL) --mode=link \

Modified: branches/2.4/raster/loader/Makefile.in
===================================================================
--- branches/2.4/raster/loader/Makefile.in	2019-07-16 08:57:58 UTC (rev 17606)
+++ branches/2.4/raster/loader/Makefile.in	2019-07-16 08:58:20 UTC (rev 17607)
@@ -79,7 +79,7 @@
 all: $(RASTER2PGSQL)
 
 raster2pgsql.o: raster2pgsql.c
-	$(CC) $(CFLAGS) -c $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
 
 $(RASTER2PGSQL): $(RT_CORE)/librtcore.a raster2pgsql.o
 	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@



More information about the postgis-tickets mailing list