Page 1 of 1

Gcc 6 alpha Pale Moon 26.2.0 build with LinkTimeOptimization enabled

Posted: 2016-04-06, 19:54
by Nheghathivhistha
Hello.

I tried to build Pale Moon 26.2.0 with experimental gcc 6.
I had to use --disable-elf-hack and --enable-gstreamer=1.0 switches for configure/config.

It compiled and linked!

When started it segfaults with
Thread 1 "palemoon" received signal SIGSEGV, Segmentation fault.
nsStyleSet::GatherRuleProcessors (this=this@entry=0xf16120, aType=aType@entry=nsStyleSet::ePresHintSheet)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/layout/style/nsStyleSet.cpp:341
341 mRuleProcessors[aType] = PresContext()->Document()->GetAttributeStyleSheet();
(gdb) bt
#0 nsStyleSet::GatherRuleProcessors (this=this@entry=0xf16120, aType=aType@entry=nsStyleSet::ePresHintSheet)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/layout/style/nsStyleSet.cpp:341
#1 0x00007ffff3202367 in nsStyleSet::_ZN10nsStyleSet9EndUpdateEv.part.130(void) (this=0xf16120)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/layout/style/nsStyleSet.cpp:595
#2 0x00007ffff315d608 in InitPresentationStuff (this=0xf44330, aDoInitialReflow=<optimized out>)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/layout/base/nsDocumentViewer.cpp:699
#3 0x00007ffff31909de in InitInternal (this=0xf44330, aParentWidget=<optimized out>, aState=aState@entry=0x0,
aBounds=..., aDoCreation=aDoCreation@entry=true, aNeedMakeCX=aNeedMakeCX@entry=true,
aForceSetNewDocument=<optimized out>)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/layout/base/nsDocumentViewer.cpp:938
#4 0x00007ffff319140c in Init (this=<optimized out>, aParentWidget=<optimized out>, aBounds=...)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/layout/base/nsDocumentViewer.cpp:674
#5 0x00007ffff3f43b5b in nsDocShell::SetupNewViewer (this=0xf124e0, aNewViewer=0xf44330)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/docshell/base/nsDocShell.cpp:8207
#6 0x00007ffff3f3823c in nsDocShell::Embed (this=0xf124e0, aContentViewer=0xf44330, aCommand=<optimized out>,
aExtraInfo=<optimized out>)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/docshell/base/nsDocShell.cpp:6231
#7 0x00007ffff3fc1f42 in nsDocShell::CreateAboutBlankContentViewer (this=0xf124e0, aPrincipal=<optimized out>,
aBaseURI=0x0, aTryToSaveOldPresentation=<optimized out>)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/docshell/base/nsDocShell.cpp:6999
#8 0x00007ffff3f4a105 in nsWebShellWindow::Initialize (widgetInitData=..., aIsHiddenWindow=<optimized out>,
aInitialHeight=<optimized out>, aInitialWidth=<optimized out>, aUrl=0xefe040, aOpener=0x0, aParent=0x0, this=0xefe170)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/xpfe/appshell/src/nsWebShellWindow.cpp:219
#9 nsAppShellService::JustCreateTopWindow (this=this@entry=0xefdfc0, aParent=aParent@entry=0x0, aUrl=0xefe040,
aChromeMask=aChromeMask@entry=4094, aInitialWidth=<optimized out>, aInitialWidth@entry=100,
aInitialHeight=<optimized out>, aInitialHeight@entry=100, aIsHiddenWindow=true, aResult=0x7fffffffb8f0)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/xpfe/appshell/src/nsAppShellService.cpp:588
#10 0x00007ffff3f4a6e2 in nsAppShellService::CreateHiddenWindowHelper (this=0xefdfc0, aIsPrivate=<optimized out>)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/xpfe/appshell/src/nsAppShellService.cpp:128
#11 0x00007ffff395ea7a in CreateHiddenWindow (this=<optimized out>)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/toolkit/components/startup/nsAppStartup.cpp:237
#12 0x00007ffff2f96159 in XRE_mainRun (this=0x7fffffffbb60)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/toolkit/xre/nsAppRunner.cpp:3346
#13 XRE_main (aAppData=<optimized out>, argv=<optimized out>, argc=<optimized out>, this=0x7fffffffbb60)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/toolkit/xre/nsAppRunner.cpp:3492
#14 XRE_main (argc=<optimized out>, argv=<optimized out>, aAppData=<optimized out>, aFlags=<optimized out>)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/toolkit/xre/nsAppRunner.cpp:3568
#15 0x0000000000403caa in do_main (argc=argc@entry=1, argv=argv@entry=0x7fffffffd3b8, xreDirectory=0x628b10)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/browser/app/nsBrowserApp.cpp:243
#16 0x0000000000402e13 in main (argc=1, argv=0x7fffffffd3b8)
at /usr/src/debug/www-client/palemoon-26.2.0/palemoon-26.2.0/browser/app/nsBrowserApp.cpp:473

Are Pale Moon developers interested in the gcc LTO?

It failed to compile using -fno-lto -fno-use-linker-plugin with elf-hack both enabled and disabled using the same version of gcc-6:

---CUT---
5:49.78 nsCategoryCache.cpp
5:49.88 In file included from ../../dist/include/mozilla/throw_gcc.h:12:0,
5:49.88 from ../../dist/stl_wrappers/new:66,
5:49.89 from ../../dist/include/mozilla/mozalloc.h:18,
5:49.89 from ../../dist/stl_wrappers/cstdlib:39,
5:49.89 from /usr/lib/gcc/x86_64-pc-linux-gnu/6.0.0/include/g++-v6/stdlib.h:36,
5:49.89 from ../../dist/system_wrappers/stdlib.h:3,
5:49.89 from ../../dist/include/mozilla/Assertions.h:17,
5:49.89 from /var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/xpcom/glue/nsCOMPtr.h:24,
5:49.89 from /var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/xpcom/glue/nsArrayUtils.h:9,
5:49.89 from /var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/xpcom/glue/nsArrayUtils.cpp:6:
5:49.89 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct()’:
5:49.89 ../../dist/include/mozilla/Util.h:166:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
5:49.89 MOZ_ASSERT(!constructed);
5:49.89 ^
5:49.89 ../../dist/include/mozilla/Util.h:166:30: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
---CUT---
The following command failed to execute properly:
c++ -o nsArrayUtils.o -c -I../../dist/stl_wrappers -I../../dist/system_wrappers -include /var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/config/gcc_hidden.h -DMOZ_GLUE_IN_PROGRAM -DNO_NSPR_10_SUPPORT -DTARGET_XPCOM_ABI="x86_64-gcc3" -I/var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/xpcom/glue/../build -I/var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/xpcom/glue -I. -I../../dist/include -I/var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/obj-x86_64-unknown-linux-gnu/dist/include/nspr -I/var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/obj-x86_64-unknown-linux-gnu/dist/include/nss -fPIC -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wcast-align -march=core2 -ggdb -pipe -flto=4 -fuse-linker-plugin -fno-lto -fno-use-linker-plugin -mno-avx -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe -DNDEBUG -DTRIMMED -g -O2 -fomit-frame-pointer -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MP -MF .deps/nsArrayUtils.o.pp /var/tmp/portage/www-client/palemoon-26.2.0/work/palemoon-26.2.0/xpcom/glue/nsArrayUtils.cpp

(Now I am using gcc-5 trunk, no LTO enabled compiled Palemoon.)

USE="dbus gtk2 official-branding optimize pulseaudio -alsa -gtk3 -necko-wifi -oss -system-libs" ABI_X86="64" LINGUAS="cs -en_GB"
CFLAGS="-march=core2 -ggdb -pipe -flto=4 -fuse-linker-plugin"
CXXFLAGS="-march=core2 -ggdb -pipe -flto=4 -fuse-linker-plugin"
LDFLAGS="-Wl,--as-needed -Wl,-O1 -flto -fuse-linker-plugin -Wl,--hash-style=gnu -Wl,--sort-common"

(Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/6.0.0/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-6.0.0/work/gcc-6.0.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/6.0.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/6.0.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.0.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.0.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.0.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/6.0.0/include/g++-v6 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/6.0.0/python --enable-languages=c,c++,fortran,ada --enable-obsolete --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 6.0.0' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --with-build-config=bootstrap-lto --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --enable-libgomp --enable-libcilkrts --enable-lto --with-isl --enable-libsanitizer
Thread model: posix
gcc version 6.0.0 20160331 (experimental) (Gentoo 6.0.0))

I will try not to use USE=optimize with LTO enabled.
Thank you.

Re: Gcc 6 alpha Pale Moon 26.2.0 build with LinkTimeOptimization enabled

Posted: 2016-04-06, 20:02
by trava90
I use LTO on occasion when compiling my builds, and have never encountered an issue when using GCC 5.3. I've not tried it on any version below or above 5.*