enable hardening build flags debian/1.4-4
authorBdale Garbee <bdale@gag.com>
Sun, 18 Mar 2012 19:53:57 +0000 (20:53 +0100)
committerBdale Garbee <bdale@gag.com>
Sun, 18 Mar 2012 19:53:57 +0000 (20:53 +0100)
debian/changelog
debian/rules

index 6e0552f4037ae67076db68cddf80571574ccdcc6..8156a05d4b61d9c4e3d65cf96cfc7a6d4fdab2de 100644 (file)
@@ -1,3 +1,9 @@
+gzip (1.4-4) unstable; urgency=low
+
+  * enable hardening build flags, closes: #664499
+
+ -- Bdale Garbee <bdale@gag.com>  Sun, 18 Mar 2012 20:16:45 +0100
+
 gzip (1.4-3) unstable; urgency=low
 
   * patch from upstream for sys_stat.in.h to fix mingw32 builds, 
index eb3b6c347babde32221b5d4dfaa91e8503d74918..83be2e58fa31bb77c72140a1f4b5e641883b90be 100755 (executable)
@@ -11,10 +11,13 @@ ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
 CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
 endif
 
+CFLAGS = `dpkg-buildflags --get CFLAGS`
+CFLAGS += -Wall
+LDFLAGS = `dpkg-buildflags --get LDFLAGS`
+CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
+
 ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),amd64)
-CFLAGS=-g -O2 -Wall -DUNALIGNED_OK
-else
-CFLAGS=-g -O2 -Wall
+CFLAGS += -DUNALIGNED_OK
 endif
 
 reconf-stamp:
@@ -27,7 +30,7 @@ configure: configure-stamp
 configure-stamp: reconf-stamp
        dh_testdir
        mkdir -p build
-       cd build && ../configure \
+       cd build && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" ../configure \
                --prefix=/usr --bindir=/bin \
                --infodir=`pwd`/debian/gzip/usr/share/info \
                --mandir=`pwd`/debian/gzip/usr/share/man $(CONFARGS)