Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 565314 - www-client/firefox-42.0 fails to build with clang+lto
Summary: www-client/firefox-42.0 fails to build with clang+lto
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2015-11-10 04:45 UTC by Jason Schulz
Modified: 2017-08-26 17:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Schulz 2015-11-10 04:45:44 UTC
Mozilla firefox fails to build using clang+lto.  In part, this is due to https://bugs.gentoo.org/show_bug.cgi?id=565312.

Specifically, the error is...

make[4]: Leaving directory '/var/tmp/portage/www-client/firefox-42.0/work/firefox-42.0/ff/extensions/universalchardet/src/xpcom'
: CommandLine Error: Option 'asm-instrumentation' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options


Reproducible: Always

Steps to Reproduce:
emerge firefox
Actual Results:  
(╯°□°)╯︵ ┻━┻

Expected Results:  
Firefox builds with LTO.
Comment 1 Jason Schulz 2015-11-10 04:49:31 UTC
Portage 2.2.20.1 (python 3.3.5-final-0, funtoo/1.0/linux-gnu/arch/pure64, gcc-4.9.3, glibc-2.20-r2, 4.2.5-gentoo x86_64)
=================================================================
System uname: Linux-4.2.5-gentoo-x86_64-Intel-R-_Core-TM-_i7-3632QM_CPU_@_2.20GHz-with-gentoo-2.2.0
KiB Mem:    12176844 total,   5943608 free
KiB Swap:    4194300 total,   4194300 free
sh bash 4.3_p39-r1
ld GNU gold (Funtoo 2.25 2.25.0) 1.11
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.2.4 [enabled]
app-shells/bash:          4.3_p39-r1::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10-r2::gentoo, 3.3.5-r2::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.3.2-r1::gentoo
sys-apps/baselayout:      2.2.0-r6::gentoo
sys-apps/openrc:          0.18.3-r1::gentoo
sys-apps/sandbox:         2.9::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25-r2::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://github.com/funtoo/ports-2012.git
    priority: -1000

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA Oracle-BCLA-JavaSE FraunhoferFDK NVIDIA-CUDA Google-TOS AdobeFlash-11.x Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=ivybridge -mtune=ivybridge -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O3 -march=ivybridge -mtune=ivybridge -flto"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg"
FEATURES="assume-digests binpkg-logs buildpkg candy ccache compress-build-logs config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersandbox usersync xattr"
FFLAGS="-march=core-avx-i -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-O3 -flto -Wl,--as-needed"
MAKEOPTS="-j16"
PKGDIR="/var/pkg/ivybridge/clang-3.7"
PORTAGE_CONFIGROOT="/"
PORTAGE_TMPDIR="/var/tmp"
USE="X aac acl acpi aio alsa amd64 avahi berkdb bluetooth bluray bzip2 c++0x c++11 c++14 cairo caps cdparanoia clang cracklib crypt cuda cups cxx dbus dri dts dvd flac gdbm gl glamor gles2 gnutls gold graphite iconv icu inotify ipv6 jemalloc jpeg jpeg2k libnotify lz4 lzma lzo matroska mmx modules mp3 mpd mpeg mudflap musicbrainz ncurses nfsv4 nfsv41 nls nptl nsplugin numa ogg opengl openmp opus otr pam pcre png pulseaudio python readline resolvconf sasl snmp spice sse sse2 ssl syslog tcpd theora threads tls udev unicode usb uxa vaapi vdpau vim-syntax vorbis vpx wayland webp wifi x264 x265 xattr xkb xml xpm xvid xvmc xz zeroconf zip zlib" ABI_X86="64" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias authn_core authz_core socache_shmcb unixd" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev synaptics keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_ABIS="2.7 3.3" PYTHON_SINGLE_TARGET="python3_3" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20 ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="modesetting intel nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 2 Jason Schulz 2015-12-28 05:42:22 UTC
FYI, as Michał mentioned in the referenced bug, this is not an issue with Clang/LLVM.

Reading Honza Hubička's post on the subject (http://hubicka.blogspot.com/2014/04/linktime-optimization-in-gcc-2-firefox.html) seems to suggest firefox can build correctly and generate better optimized binaries with link-time optimization as a default (>30).

I would guess there aren't any distributions building firefox with LTO for any compiler yet, however I'm willing to space-monkey for it.  Since it's a larger package and especially CPU intensive, I think LTO could be a significant benefit.
Comment 3 Jan Chren (rindeal) 2016-04-29 16:28:40 UTC
(In reply to Jason Schulz from comment #2)
> FYI, as Michał mentioned in the referenced bug, this is not an issue with
> Clang/LLVM.

It is, GCC+LTO works fine
Comment 4 Jason Schulz 2016-04-30 01:24:12 UTC
(In reply to Jan Chren (rindeal) from comment #3)
> (In reply to Jason Schulz from comment #2)
> > FYI, as Michał mentioned in the referenced bug, this is not an issue with
> > Clang/LLVM.
> 
> It is, GCC+LTO works fine

This is an older bug and I haven't tried building firefox with LTO (Clang/LLVM or GCC) recently, so this may be resolved.

Has anyone recently built firefox (46?) with link time optimization (-flto) enabled?
Comment 5 Jory A. Pratt gentoo-dev 2017-08-26 17:56:54 UTC
If you feel I have closed your bug and it is still a current issue, please reopen and update it completely. We will not work bugs that have no ebuild in tree any longer or can not be reproduced with a current system.

Thank You for your support and understanding
The Mozilla Team