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

This commit is contained in:
Adam Jackson 2011-08-01 12:26:41 -04:00
parent 8e60e55b8a
commit 796b80f2f4
2 changed files with 24 additions and 2 deletions

View File

@ -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

View File

@ -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@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@redhat.com> 9.1.0-13
- redhat-rpm-config-9.1.0-relro.patch: LDFLAGS, not CFLAGS.