From 51811936c4412a2fdba131f579019f9594443e7c Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 1 Aug 2011 12:26:41 -0400 Subject: [PATCH] redhat-rpm-config-9.1.0-hardened.patch: Add macro magic for %_hardened_build --- macros | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macros b/macros index 743652a..e2bdcf3 100644 --- a/macros +++ b/macros @@ -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