CONFIGURE: Don't use the Gold linker on i386/ppc (unless using --enable-gold)#6285
Conversation
|
Thanks! Both Debian and Fedora use |
|
Mold is not a linker installed everywhere, bfd is a good default. |
Yes, bfd often already is the default ld binary on ELF systems. |
Yeah, but for some reason, they've hardcoded bfd in the Fedora patch. We could assume that bfd is always available on Fedora, but if this is true, why would they hardcode it in their patch? Here's the Fedora patch, for reference: |
Yes, as discussed on Discord, I thought that they did that just because, in their case, such a big override was always guaranteed to work (instead of analyzing what we're doing with the We can't just hardcode I'll put the PR on hold until I'm done with some tests on Fedora, to be sure. Maybe they did set up |
|
The patch was added by Fedora in 2020. |
…s using --enable-gold Debian, Fedora and Slackware have been building their official ScummVM packages with --disable-gold for a while, because of build failures on (at least) i386: https://salsa.debian.org/games-team/scummvm/-/commit/a6afd58cf8cb8bb39ee1b1fd764ff1721b1001f4 https://src.fedoraproject.org/rpms/scummvm/c/e737fe0c41f2c9cff8400defaab10908b553db18?branch=rawhide https://git.slackbuilds.org/slackbuilds/commit/games/scummvm?id=d3ce31e0215d7d6fdf7bdecac1bad499a0e0167d I saw a similar issue on Linux ppc32 myself (linker internal error when doing a full `-Og -g` build with all engines), and both Gentoo and Fedora treat Gold as a deprecated linker nowadays, anyway. Alternative linkers exist (mold, lld...), and ld.bfd often is a safe default (and AFAICS it's not as slow at it used to be). People really wanting to use Gold on other archs can still ask for it with --enable-gold. Out of simplicity, this patch doesn't handle the case where Gold would be the default OS linker. We hope no system is doing that, if its linker is known to have this kind of issues.
d406401 to
c4bbe74
Compare
|
Thanks. I've spent some time trying to reproduce the original Gold issues with x86 VMs of Fedora 34 and Slackware 14.2 (whose release dates could match the date of the patches added to these distributions). I couldn't reproduce the problems there, though. The only environment where I could reproduce this is the (old) ppc32 VM I've described above. Anyway, I've updated the PR with some recent feedback over Discord. Now this PR does this:
If this simpler approach is still an issue, let's wait for people to report it. So far, we've only seen some distros fixed that on their sides, but that was some years ago, and no end-user (or distro maintainer) reported a real problem for that. So I'd say the updated PR should be simple enough… |
|
Much simpler and cleaner approach. Thanks! |
|
@dwatteau Guess what... gold linker is now deprecated by GNU.
I think we should not make use of it by default anymore. |
Ha, nice timing 🙃 Thanks for the info! I've submitted a PR for that, then: #6431 |
Debian and Fedora have been building their official ScummVM packages with
--disable-goldfor a while, because of build failures on (at least) i386:[1],[2].I saw a similar issue with Gold and the ppc32 QEMU VM myself (
internal error in relocate, at ../../gold/powerpc.cc:6773when doing a full build with all engines), and both Gentoo and Fedora think of Gold as a deprecated linker nowadays, anyway:[1],[2],[3].So this PR disables the Gold linker on i386 and ppc. People really wanting to use it there can still use it with an explicit
--enable-gold.Alternative linkers exist (
mold,lld...) and are already supported, and otherwiseld.bfdoften is a safe default (and AFAICS it's not as slow at it used to be).Any objection to this? The idea is to take care, by default, of the build issues that Fedora and Debian have been having with Gold. It looks like (at least) the
master-debian-i686buildbot will be impacted by this change. (By the way, since it appears that this buildbot target never had an issue wild Gold, maybe we could disable its usage for older Gold releases only. But I can't say where to draw the line. Fedora/Debian hit the bug in 2020/2021, and Gold didn't receive many commits since then.)EDIT: the issue was also present in early 2021 Slackware:
[1]