From 796b80f2f49f2301d2687fd3c12d12d8d2b2dc59 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Aug 01 2011 16:26:41 +0000 Subject: redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %_hardened_build --- 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 9.1.0-14 +- redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %%_hardened_build + * Thu Jul 07 2011 Adam Jackson 9.1.0-13 - redhat-rpm-config-9.1.0-relro.patch: LDFLAGS, not CFLAGS.