commit:     5df57a6c6ba6b0ac3b13a53a840d0cf038389ec2
Author:     Jory A. Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  6 17:52:41 2017 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Tue Jun  6 17:52:41 2017 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=5df57a6c

eclass/mozcoreconf-v5: Force -O2 optimization if gcc-7 or better is used

 eclass/mozcoreconf-v5.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eclass/mozcoreconf-v5.eclass b/eclass/mozcoreconf-v5.eclass
index 4ecfbd8..9a15798 100644
--- a/eclass/mozcoreconf-v5.eclass
+++ b/eclass/mozcoreconf-v5.eclass
@@ -156,7 +156,9 @@ mozconfig_init() {
        ####################################
 
        # Set optimization level
-       if [[ ${ARCH} == hppa ]]; then
+       if [[ $(gcc-major-version) -ge 7 ]]; then
+               mozconfig_annotate "Workaround known breakage" 
--enable-optimize=-O2
+       elif [[ ${ARCH} == hppa ]]; then
                mozconfig_annotate "more than -O0 causes a segfault on hppa" 
--enable-optimize=-O0
        elif [[ ${ARCH} == x86 ]]; then
                mozconfig_annotate "less then -O2 causes a segfault on x86" 
--enable-optimize=-O2

Reply via email to