www-client/firefox: use -fdisable-ipa-cdtor workaround when AVX2 is not available
authorThomas Deutschmann <whissi@gentoo.org>
Mon, 11 Feb 2019 15:21:32 +0000 (16:21 +0100)
committerThomas Deutschmann <whissi@gentoo.org>
Mon, 11 Feb 2019 15:21:53 +0000 (16:21 +0100)
This commit changes commit da3675965824a307cd16ffc48193929ba8125d98.

Bug: https://bugs.gentoo.org/677052
Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
www-client/firefox/firefox-65.0-r1.ebuild

index 56719723d0af30f5b9f1097ed2ce5da8ab938e07..5fe43fe3beee3949a0c8ac5db4ae8045c4c07c87 100644 (file)
@@ -131,10 +131,7 @@ DEPEND="${CDEPEND}
 # Due to a bug in GCC, profile guided optimization will produce
 # AVX2 instructions, bug #677052
 REQUIRED_USE="wifi? ( dbus )
-       pgo? (
-               lto
-               !clang? ( cpu_flags_x86_avx2 )
-       )"
+       pgo? ( lto )"
 
 S="${WORKDIR}/firefox-${PV%_*}"
 
@@ -321,6 +318,15 @@ src_configure() {
                                show_old_compiler_warning=1
                        fi
 
+                       if ! use cpu_flags_x86_avx2 ; then
+                               # due to a GCC bug, GCC will produce AVX2 instructions
+                               # even if the CPU doesn't support AVX2, https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01142.html
+                               einfo "Disable IPA cdtor due to bug in GCC and missing AVX2 support -- triggered by USE=lto"
+                               append-ldflags -fdisable-ipa-cdtor
+                       else
+                               einfo "No GCC workaround required, system supports AVX2"
+                       fi
+
                        # Linking only works when using ld.gold when LTO is enabled
                        mozconfig_annotate "forcing ld=gold due to USE=lto" --enable-linker=gold
                fi