palemoon-26.4.0: building fails with gcc-6.1.0 due to forced -flto

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
vaeth

palemoon-26.4.0: building fails with gcc-6.1.0 due to forced -flto

Unread post by vaeth » 2016-08-19, 14:22

Linux, gcc-6.1.0 (with --enable-default-ssp --disable-default-pie);
same behaviour on amd64 and x86.

The (only) errors in the log are obviously due to the forced "-flto":

Code: Select all

 temp/cc9PyL0z.ltrans23.ltrans.o: In function `MemoryReporter_XPTInterfaceInfoManager::GetAmount(long*)':
 <artificial>:(.text._ZN38MemoryReporter_XPTInterfaceInfoManager9GetAmountEPl+0x1a): undefined reference to `XPT_SizeOfArena'
 temp/cc9PyL0z.ltrans23.ltrans.o: In function `mozilla::XPTInterfaceInfoManager::GetSingleton()':
 <artificial>:(.text._ZN7mozilla23XPTInterfaceInfoManager12GetSingletonEv+0xb0): undefined reference to `XPT_NewArena'
 temp/cc9PyL0z.ltrans24.ltrans.o: In function `nsComponentManagerImpl::ManifestXPT(nsComponentManagerImpl::ManifestProcessingContext&, int, char* const*)':
 <artificial>:(.text._ZN22nsComponentManagerImpl11ManifestXPTERNS_25ManifestProcessingContextEiPKPc+0xb6): undefined reference to `XPT_NewXDRState'
 <artificial>:(.text._ZN22nsComponentManagerImpl11ManifestXPTERNS_25ManifestProcessingContextEiPKPc+0xd2): undefined reference to `XPT_MakeCursor'
 <artificial>:(.text._ZN22nsComponentManagerImpl11ManifestXPTERNS_25ManifestProcessingContextEiPKPc+0xe2): undefined reference to `XPT_DestroyXDRState'
 <artificial>:(.text._ZN22nsComponentManagerImpl11ManifestXPTERNS_25ManifestProcessingContextEiPKPc+0x189): undefined reference to `XPT_DoHeader'
 <artificial>:(.text._ZN22nsComponentManagerImpl11ManifestXPTERNS_25ManifestProcessingContextEiPKPc+0x1b4): undefined reference to `XPT_ArenaMalloc'
 <artificial>:(.text._ZN22nsComponentManagerImpl11ManifestXPTERNS_25ManifestProcessingContextEiPKPc+0x340): undefined reference to `XPT_ArenaMalloc'
I am not happy about the forced -flto on gcc-6 anyway, because I have machines with 512M or 2G on which I want to build. Since it is added last in the list of flags, I cannot even override it with C{,XX}FLAGS.

So I decided to patch out the -flto forcing. As a result, I get the first error from

viewtopic.php?t=12045

When patching out the offending command as suggested in the thread (and keeping patching out -flto) I get a succesfull compilation, and the resulting binary is running without any issues.

User avatar
trava90
Contributing developer
Contributing developer
Posts: 1742
Joined: 2013-05-20, 18:19
Location: Somewhere in Sector 001

Re: palemoon-26.4.0: building fails with gcc-6.1.0 due to forced -flto

Unread post by trava90 » 2016-08-19, 14:56

-flto was required based on all my testing and by talking to other people who tried using GCC 6.0. I guess something must have changed between 6.0 and 6.1. I'll submit a pull request later today removing the -flto flag.

EDIT: https://github.com/MoonchildProductions ... n/pull/483

vaeth

Re: palemoon-26.4.0: building fails with gcc-6.1.0 due to forced -flto

Unread post by vaeth » 2016-08-19, 15:30

Please note that this still causes the first error in viewtopic.php?t=12045
unless

Code: Select all

sed -ie '/MOZ_ASSERT/d' mfbt/Util.h
is done. I don't know why this MOZ_ASSERT is not accepted with gcc-6