kde-plasma packages fail with undefined reference when built against dev-qt/qtgui with LTO enabled
I need to set dev-qt/qtgui *FLAGS-=-flto* so I can build plasma-integration and kwin. Probably other packages would fail too, but portage aborts the other kde package after this point.
Without the workaround I get errors in the line of
/var/tmp/portage/kde-plasma/plasma-integration-5.14.3/temp/ccXpedya.ltrans1.ltrans.o:<artificial>:function QDBusMenuBar::createMenu() const: error: undefined reference to 'QDBusPlatformMenu::QDBusPlatformMenu()'
I am happy to provide more detailed information if this is not easily reproducible on your side. I would have to reset the workaround and build qtgui again, so I'm holding off for now.
Interesting. I use KDE myself, and I haven't experienced this. Could you provide your emerge --info and your build.log?
Here is the requested info: emerge.info.txt kwin_build.log plasma-integration_build.log
I notice you are using some hardened features, such as -Wl,-z,relro -Wl,-z,now. Would you mind trying these builds without these linker flags? If that fails, could you try removing -Wl,--as-needed too? I'm curious if these make a difference for you as I haven't tested GentooLTO in hardened configurations yet, and I think this would be a good mention in README.md.
We've had one more issue pop up recently about Qt symbols. I will do a full rebuild of Qt and KDE to see if I can reproduce the issue.
I tried removing the mentioned linker flags, with both qtgui and plasma-integration, verified in the emerge output, but it did not seem to change anything. The undefined references remain.
I've had LTO enabled for quite some time, writing my own exceptions in package.env. Only recently I migrated over to your repository and package.cflags. However after moving to gentoo-lto I didn't do a full system rebuild since the cflags were about the same (and I'm probably not going to).
The link failures seem to come from symbols (mistakenly optimized out) within qtgui, so it is unlikely that any other package ares involved, am I right? So a full system rebuild shouldn't affect anything anyway, or am I wrong?
I would at the very least do a full rebuild of Qt to see if the problems resolve. So far, I can't reproduce the issue locally here.
I now did a full rebuild of world, but alas, no change. Also tried various combinations of USE-flags for dev-qt/qtgui, also to no avail.
I leave it to you to close or leave open this issue. I personally am satisfied with having the exception in my package.cflags. I will periodically check if something has changed and add a comment here if I find out something new.
Yeah I can't reproduce this issue -- I'll leave it open in case someone else can. Have you tried @pchome 's EXTRA_*FLAGS workarounds?
I just committed some changes to dev-qt/qtcore, could you rebuild that and dev-qt/qtgui and try kwin and plasma-integration?
I tried out rebuilding only dev-qt/qtcore and dev-qt/qtgui, but the KDE packages would still fail.
Fast forward a few days of tinkering while doing other work. Among other things I moved to sourcing make.conf.lto directly in my make.conf.
Over night I did another full system rebuild and now it seems to be working. I have no idea what changed. Especially since the first emerge -ave world didn't solve the issue.
But now all KDE packages now emerge fine without additional overrides!
One other issue surfaced, but I have to verify that and will perhaps open another bug if I can verify it.
Excellent -- I'll close the issue since it sounds like you've solved it. Feel free to comment though and I'll reopen it.