Bug 302387 - kdelibs fails to compile with gcc-4.7.1 and LTO enabled
Summary: kdelibs fails to compile with gcc-4.7.1 and LTO enabled
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (other bugs)
Version First Reported In: 4.8.4
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-23 03:50 UTC by David
Modified: 2023-02-03 05:03 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Full build log (216.21 KB, text/plain)
2012-06-23 03:55 UTC, David
Details
Full build log (216.21 KB, application/x-bzip2)
2012-06-23 03:56 UTC, David
Details
Patch to compile with lto (1.72 KB, patch)
2013-12-04 21:28 UTC, Raul Fernandes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David 2012-06-23 03:50:23 UTC
I am getting several undefined references when compiling kdelibs 4.8.4 with gcc 4.7.1 (latest) and lto enabled (-flto and -Wl,-flto).
I'll attach the full build log later, but these are the relevant lines (in linking stage when cmake reports 100% progress)
/var/tmp/portage/kde-base/kdelibs-4.8.4/temp/cc5JUBsS.ltrans0.ltrans.o:cc5JUBsS.ltrans0.o:function _ZN5khtml8IDStringINS_13PrefixFactoryEED2Ev.local.62.3422: error: undefined reference to 'khtml::PrefixFactory::s_idTable'
/var/tmp/portage/kde-base/kdelibs-4.8.4/temp/cc5JUBsS.ltrans0.ltrans.o:cc5JUBsS.ltrans0.o:function _ZN5khtml8IDStringINS_16NamespaceFactoryEED2Ev.local.64.3544: error: undefined reference to 'khtml::NamespaceFactory::s_idTable'
/var/tmp/portage/kde-base/kdelibs-4.8.4/temp/cc5JUBsS.ltrans0.ltrans.o:cc5JUBsS.ltrans0.o:function _ZN5khtml8IDStringINS_13PrefixFactoryEED2Ev.local.62.3422: error: undefined reference to 'khtml::IDTableBase::releaseId(unsigned int)'
/var/tmp/portage/kde-base/kdelibs-4.8.4/temp/cc5JUBsS.ltrans0.ltrans.o:cc5JUBsS.ltrans0.o:function _ZN5khtml8IDStringINS_16NamespaceFactoryEED2Ev.local.64.3544: error: undefined reference to 'khtml::IDTableBase::releaseId(unsigned int)'

(seems all related to khtml)

Reproducible: Always
Comment 1 David 2012-06-23 03:55:39 UTC
Created attachment 72059 [details]
Full build log

Full build log for kdelibs-4.8.4 (problems are near the end of file)
Comment 2 David 2012-06-23 03:56:41 UTC
Created attachment 72060 [details]
Full build log

Corrected attachment's myme type
Comment 3 Colin MacLean 2012-09-27 04:09:08 UTC
My build fails at the same place. It should be noted that -fvisibility=hidden is also enabled.

KDE_EXPORT on the Factories and releaseId() successfully keeps the compiler/linker from optimizing away these symbols. It could be argued that compiler is being overaggressive with the optimizations of the factories, but adding KDE_EXPORT shouldn't hurt anything. khtml::IDTableBase::releaseID(unsigned int) is private, so I can see how the compiler would think it is safe to optimize that out.

There may be other symbols that weren't exported that need to be, but I haven't finished building kde, yet.
Comment 4 Raul Fernandes 2013-12-04 21:28:12 UTC
Created attachment 83933 [details]
Patch to compile with lto

Patch to be applied against 4.11.3
Comment 5 Raul Fernandes 2013-12-04 21:28:58 UTC
Try this patch to see if the kdelibs compiles with lto now.
It works for me.
Comment 6 Andrew Crouthamel 2018-11-11 04:30:29 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Andrew Crouthamel 2018-11-21 04:25:38 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Justin Zobel 2023-01-04 07:05:45 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 9 Bug Janitor Service 2023-01-19 05:13:14 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Bug Janitor Service 2023-02-03 05:03:00 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!