diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index ebb620fe..c23ff601 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri May 13 00:00:00 CEST 2016 - dsterba@suse.cz + +- enable build with PIE and full relro on x86_64 (boo#980384) + ------------------------------------------------------------------- Wed May 4 10:27:43 UTC 2016 - wr@rosenauer.org diff --git a/MozillaFirefox.spec b/MozillaFirefox.spec index 532fd48b..d5bfe5b0 100644 --- a/MozillaFirefox.spec +++ b/MozillaFirefox.spec @@ -23,6 +23,9 @@ %define update_channel release %define releasedate 2016050300 +# PIE, full relro (x86_64 for now) +%define build_hardened 1 + # general build definitions %if "%{update_channel}" != "aurora" %define progname firefox @@ -318,6 +321,13 @@ export CFLAGS="${CFLAGS/-g / }" # Limit RAM usage during link export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif + +%if 0%{?build_hardened} +%ifarch x86_64 +export LDFLAGS="${LDFLAGS} -Wl,-z,relro,-z,now" +%endif +%endif + %ifarch ppc64 ppc64le export CFLAGS="$CFLAGS -mminimal-toc" %endif @@ -340,6 +350,9 @@ ac_add_options --enable-default-toolkit=cairo-gtk3 %else ac_add_options --enable-default-toolkit=cairo-gtk2 %endif +%if 0%{?build_hardened} +ac_add_options --enable-pie +%endif %ifarch %ix86 %arm %if 0%{?suse_version} > 1230 ac_add_options --disable-optimize