[SCM] x264/master: Add hardened build flags excluding -O2 and -g.

ceros-guest at users.alioth.debian.org ceros-guest at users.alioth.debian.org
Sat Mar 17 17:43:59 UTC 2012


The following commit has been merged in the master branch:
commit 5bb65dc541c34127f3b0d056d5c849316bc08d90
Author: Andres Mejia <amejia004 at gmail.com>
Date:   Sat Mar 17 13:38:02 2012 -0400

    Add hardened build flags excluding -O2 and -g.

diff --git a/debian/changelog b/debian/changelog
index 075ee37..e7a35f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,8 +2,9 @@ x264 (2:0.120.2171+git01f7a33-2) unstable; urgency=low
 
   * Allow dev package to be multiarch installable.
   * Bump to Standards-Version 3.9.3.
+  * Add hardened build flags excluding -O2 and -g.
 
- -- Andres Mejia <amejia at debian.org>  Sat, 17 Mar 2012 13:17:48 -0400
+ -- Andres Mejia <amejia at debian.org>  Sat, 17 Mar 2012 13:37:11 -0400
 
 x264 (2:0.120.2171+git01f7a33-1) unstable; urgency=low
 
diff --git a/debian/confflags b/debian/confflags
index bb019e8..95e6f5b 100644
--- a/debian/confflags
+++ b/debian/confflags
@@ -2,8 +2,13 @@
 # vi:syntax=make
 # configure flags logic
 
-# Set CFLAGS from DEB_CFLAGS if defined, otherwise simply add -Wall
-CFLAGS = $(or $(DEB_CFLAGS),-Wall)
+# Set CFLAGS from DEB_CFLAGS if defined, otherwise add build flags from
+# dpkg-buildflags excluding -g and -O2.
+CFLAGS = $(or $(DEB_CFLAGS),$(shell dpkg-buildflags --get CFLAGS 2>/dev/null | sed -e 's/-g\|-O2//g'))
+ifeq (,$(CFLAGS))
+  # Handle case for versions of Debian/Ubuntu that have dpkg-dev (<< 1.15.7).
+  CFLAGS = -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security
+endif
 
 LDFLAGS := $(filter-out %-Bsymbolic-functions,$(LDFLAGS))
 

-- 
x264 packaging



More information about the pkg-multimedia-commits mailing list