[redhat-rpm-config] redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %_hardened_build

Adam Jackson ajax at fedoraproject.org
Mon Aug 1 16:26:53 UTC 2011


commit 796b80f2f49f2301d2687fd3c12d12d8d2b2dc59
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Aug 1 12:26:41 2011 -0400

    redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %_hardened_build

 redhat-rpm-config-9.1.0-hardened.patch |   18 ++++++++++++++++++
 redhat-rpm-config.spec                 |    8 ++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/redhat-rpm-config-9.1.0-hardened.patch b/redhat-rpm-config-9.1.0-hardened.patch
new file mode 100644
index 0000000..710a2c3
--- /dev/null
+++ b/redhat-rpm-config-9.1.0-hardened.patch
@@ -0,0 +1,18 @@
+diff -up redhat-rpm-config-9.1.0/macros.jx redhat-rpm-config-9.1.0/macros
+--- redhat-rpm-config-9.1.0/macros.jx	2011-08-01 11:01:08.000000000 -0400
++++ redhat-rpm-config-9.1.0/macros	2011-08-01 11:14:53.438448217 -0400
+@@ -184,8 +184,12 @@ unset DISPLAY\
+ %__find_provides        /usr/lib/rpm/redhat/find-provides
+ %__find_requires        /usr/lib/rpm/redhat/find-requires
+ 
+-%__global_cflags	-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
+-%__global_ldflags	-Wl,-z,relro
++#_hardened_build	0
++%_hardened_cflags	%{?_hardened_build:-fPIE}
++%_hardened_ldflags	%{?_hardened_build:-Wl,-z,now -pie}
++
++%__global_cflags	-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 %{?_hardened_cflags}
++%__global_ldflags	-Wl,-z,relro %{?_hardened_ldflags}
+ 
+ # Use these macros to differentiate between RH and other KMP implementation(s).
+ redhat_kernel_module_package	1
diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec
index bba179e..6f19bac 100644
--- a/redhat-rpm-config.spec
+++ b/redhat-rpm-config.spec
@@ -1,7 +1,7 @@
 Summary: Red Hat specific rpm configuration files
 Name: redhat-rpm-config
 Version: 9.1.0
-Release: 13%{?dist}
+Release: 14%{?dist}
 # No version specified.
 License: GPL+
 Group: Development/System
@@ -19,11 +19,11 @@ Patch3: redhat-rpm-config-9.1.0-pkgconfig-private.patch
 Patch4: redhat-rpm-config-9.1.0-arches-macros.patch
 Patch5: redhat-rpm-config-9.1.0-arm.patch
 Patch6: redhat-rpm-config-9.1.0-relro.patch
+Patch7: redhat-rpm-config-9.1.0-hardened.patch
 BuildArch: noarch
 Requires: mktemp
 Requires: rpm >= 4.6.0
 BuildRequires: libtool
-BuildRoot: %{_tmppath}/%{name}-root
 
 %description
 Red Hat specific rpm configuration files.
@@ -37,6 +37,7 @@ Red Hat specific rpm configuration files.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %build
 
@@ -57,6 +58,9 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_sysconfdir}/rpm/*
 
 %changelog
+* Mon Aug 01 2011 Adam Jackson <ajax at redhat.com> 9.1.0-14
+- redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %%_hardened_build
+
 * Thu Jul 07 2011 Adam Jackson <ajax at redhat.com> 9.1.0-13
 - redhat-rpm-config-9.1.0-relro.patch: LDFLAGS, not CFLAGS.
 


More information about the scm-commits mailing list