[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#653488: Please enable hardened build flags



Package: xterm
Version: 276-1
Severity: important
Tags: patch

Please enable hardened build flags through dpkg-buildflags.
Patch attached.

Cheers,
        Moritz
diff -aur xterm-276.orig/debian/rules xterm-276/debian/rules
--- xterm-276.orig/debian/rules	2011-12-28 21:50:05.000000000 +0100
+++ xterm-276/debian/rules	2011-12-28 21:52:47.000000000 +0100
@@ -20,12 +20,12 @@
 	confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
 endif
 
-CFLAGS = -g -Wall
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
-endif
+CFLAGS = `dpkg-buildflags --get CFLAGS`
+CFLAGS += -Wall
+
+LDFLAGS_DEF = `dpkg-buildflags --get LDFLAGS`
+CPPFLAGS_DEF = `dpkg-buildflags --get CPPFLAGS`
+
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 	MAKEFLAGS += -j$(NUMJOBS)
@@ -66,6 +66,8 @@
 		$(confflags) \
 		DESKTOP_FLAGS="$(DESKTOP_FLAGS)" \
 		CFLAGS="$(CFLAGS)" \
+		CPPFLAGS="$(CPPFLAGS_DEF)" \
+		LDFLAGS="$(LDFLAGS_DEF)" \
 		LUIT=/usr/bin/luit
 	touch $@
 
Nur in xterm-276/debian: rules~.

Reply to: