Package: emacs23
Version: 23.3+1-4
Severity: important
Tags: patch

Hi Rob,
Please enabled hardened build flags through dpkg-buildflags.

Patch attached. (dpkg-buildflags abides "noopt" from DEB_BUILD_OPTIONS)

Cheers,
        Moritz
diff -aur emacs23-23.3+1.orig/debian/rules emacs23-23.3+1/debian/rules
--- emacs23-23.3+1.orig/debian/rules	2011-10-26 02:56:01.000000000 +0200
+++ emacs23-23.3+1/debian/rules	2012-01-08 17:15:27.000000000 +0100
@@ -168,12 +168,16 @@
 
 deb_host_multiarch := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
-LDFLAGS   := -g
-CFLAGS    := -DDEBIAN -g
+CFLAGS = `dpkg-buildflags --get CFLAGS`
+CFLAGS += -Wall
+LDFLAGS = `dpkg-buildflags --get LDFLAGS`
+CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
 
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-  CFLAGS += -O0
-else # not noopt
+
+LDFLAGS   += -g
+CFLAGS    += -DDEBIAN
+
+ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
   ifneq (,$(filter $(DEB_HOST_ARCH),m68k ia64))
     # Fix a problem with newer versions of gcc on m68k and ia64.
     # There -O2 causes a build failure (broken byte compiler) - see
@@ -463,13 +467,13 @@
   rm -rf $(1)
   mkdir $(1)
   cp -a $$(ls -A | grep -v '^debian$$' | grep -v '^.pc$$') "$(1)"
-  cd $(1) && CFLAGS="$(CFLAGS)" ./configure $(confflags) $(2)
+  cd $(1) && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" ./configure $(confflags) $(2)
 endef
 
 define build_cmd
-  $(MAKE) -C $(1) -j $(joblimit) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+  $(MAKE) -C $(1) -j $(joblimit) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
   # If we don't use bootstrap, we need to explicitly build info.
-  $(MAKE) -C $(1) -j $(joblimit) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" info
+  $(MAKE) -C $(1) -j $(joblimit) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" info
 endef
 
 override_dh_auto_configure: debian/setup-stamp
Nur in emacs23-23.3+1/debian: rules~.

Reply via email to