commit:     4694c68a6b60520d02af98fc1fced6dfc642ee93
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 10 16:06:47 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Tue Sep 10 16:06:47 2019 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=4694c68a

www-client/firefox: fix lto builds

Closes: https://bugs.gentoo.org/689358
Closes: https://bugs.gentoo.org/693654
Package-Manager: Portage-2.3.75, Repoman-2.3.17
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 .../firefox/files/firefox-69.0-lto-gcc-fix.patch   | 26 ++++++++++++++++++++++
 ...{firefox-69.0.ebuild => firefox-69.0-r1.ebuild} |  6 ++---
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/www-client/firefox/files/firefox-69.0-lto-gcc-fix.patch 
b/www-client/firefox/files/firefox-69.0-lto-gcc-fix.patch
new file mode 100644
index 0000000..9fe9673
--- /dev/null
+++ b/www-client/firefox/files/firefox-69.0-lto-gcc-fix.patch
@@ -0,0 +1,26 @@
+# HG changeset patch
+# Parent  79ae951dc72ba16a2451c4cde7298aa986376b0c
+Fix lto builds of sandbox on linux
+
+diff --git a/security/sandbox/linux/moz.build 
b/security/sandbox/linux/moz.build
+--- a/security/sandbox/linux/moz.build
++++ b/security/sandbox/linux/moz.build
+@@ -95,17 +95,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
+     CXXFLAGS += ['-Wno-shadow']
+     SOURCES['../chromium/sandbox/linux/services/syscall_wrappers.cc'].flags 
+= [
+         '-Wno-empty-body',
+     ]
+ 
+ # gcc lto likes to put the top level asm in syscall.cc in a different 
partition
+ # from the function using it which breaks the build.  Work around that by
+ # forcing there to be only one partition.
+-for f in CONFIG['OS_CXXFLAGS']:
++for f in CONFIG['MOZ_LTO_CFLAGS']:
+     if f.startswith('-flto') and CONFIG['CC_TYPE'] != 'clang':
+         LDFLAGS += ['--param', 'lto-partitions=1']
+ 
+ DEFINES['NS_NO_XPCOM'] = True
+ DisableStlWrapping()
+ 
+ LOCAL_INCLUDES += ['/security/sandbox/linux']
+ LOCAL_INCLUDES += ['/security/sandbox/chromium-shim']

diff --git a/www-client/firefox/firefox-69.0.ebuild 
b/www-client/firefox/firefox-69.0-r1.ebuild
similarity index 99%
rename from www-client/firefox/firefox-69.0.ebuild
rename to www-client/firefox/firefox-69.0-r1.ebuild
index 8e13dc4..4e89b4f 100644
--- a/www-client/firefox/firefox-69.0.ebuild
+++ b/www-client/firefox/firefox-69.0-r1.ebuild
@@ -257,6 +257,7 @@ src_unpack() {
 src_prepare() {
        use !wayland && rm -f "${WORKDIR}/firefox/2019_mozilla-bug1539471.patch"
        eapply "${WORKDIR}/firefox"
+       eapply "${FILESDIR}${PN}-69.0-lto-gcc-fix.patch"
 
        # Allow user to apply any additional patches without modifing ebuild
        eapply_user
@@ -384,9 +385,6 @@ src_configure() {
                                show_old_compiler_warning=1
                        fi
 
-                       # Bug 689358
-                       append-cxxflags -flto
-
                        if ! use cpu_flags_x86_avx2 ; then
                                local _gcc_version_with_ipa_cdtor_fix="8.3"
                                local 
_current_gcc_version="$(gcc-major-version).$(gcc-minor-version)"
@@ -431,7 +429,7 @@ src_configure() {
                if use clang ; then
                        # This is upstream's default
                        mozconfig_annotate "forcing ld=lld due to USE=clang" 
--enable-linker=lld
-               elif tc-ld-is-gold ; then
+               elif tc-ld-is-gold || use lto ; then
                        mozconfig_annotate "linker is set to gold" 
--enable-linker=gold
                else
                        mozconfig_annotate "linker is set to bfd" 
--enable-linker=bfd

Reply via email to