Expose %_hardening_{c,ld}flags independently to make it easier for packages to apply them to selected components

This commit is contained in:
Adam Jackson 2011-09-16 16:49:56 -04:00 committed by Ville Skyttä
parent 8174ec3d10
commit 5034f24e6a
1 changed files with 6 additions and 3 deletions

9
macros
View File

@ -185,9 +185,12 @@ unset DISPLAY\
%__find_provides /usr/lib/rpm/redhat/find-provides
%__find_requires /usr/lib/rpm/redhat/find-requires
# define _hardened_build to non-zero to enable
%_hardened_cflags %{?_hardened_build:-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1}
%_hardened_ldflags %{?_hardened_build:-specs=/usr/lib/rpm/redhat/redhat-hardened-ld}
%_hardening_cflags -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
%_hardening_ldflags -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
#_hardened_build 0
%_hardened_cflags %{?_hardened_build:%{_hardening_cflags}}
%_hardened_ldflags %{?_hardened_build:%{_hardening_ldflags}}
%__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}