[Scummvm-git-logs] scummvm master -> eb904f67e59eecb00eb5e7e81cdd469dc91a3d8a

bluegr noreply at scummvm.org
Thu Jan 30 16:01:03 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
eb904f67e5 CONFIGURE: Avoid using the Gold linker on non-mainstream archs, unless using --enable-gold


Commit: eb904f67e59eecb00eb5e7e81cdd469dc91a3d8a
    https://github.com/scummvm/scummvm/commit/eb904f67e59eecb00eb5e7e81cdd469dc91a3d8a
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-01-30T18:00:58+02:00

Commit Message:
CONFIGURE: Avoid using the Gold linker on non-mainstream archs, unless 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.

Changed paths:
    configure


diff --git a/configure b/configure
index e19fc34a8c7..902355c5f79 100755
--- a/configure
+++ b/configure
@@ -216,7 +216,7 @@ _pandoc=no
 _curl=yes
 _lld=no
 _mold=no
-_gold=yes
+_gold=auto
 # Default vkeybd/eventrec options
 _vkeybd=no
 _eventrec=no
@@ -2552,6 +2552,19 @@ else
 	define_in_config_if_yes yes 'NO_CXX11_ALIGNAS'
 fi
 
+# The Gold linker had known issues on at least i386 and ppc32, in some cases.
+# Since this linker is not very maintained anymore, and since alternatives exist,
+# avoid using it on non-mainstream archs, unless --enable-gold was explicitly given.
+if test "$_gold" = auto; then
+	case $_host_cpu in
+		aarch64 | x86_64 | amd64)
+			;;
+		*)
+			_gold=no
+			;;
+	esac
+fi
+
 #
 # Determine extra build flags for debug and/or release builds
 #
@@ -2587,7 +2600,7 @@ if test "$_debug_build" != no; then
 			append_var LDFLAGS "-fuse-ld=mold"
 			append_var LDFLAGS "-Wl,--gdb-index"
 			echo_n -- " + Mold"
-		elif test "$_gold" = yes && cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index; then
+		elif test "$_gold" != no && cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index; then
 			append_var LDFLAGS "-fuse-ld=gold"
 			append_var LDFLAGS "-Wl,--gdb-index"
 			echo_n -- " + Gold"




More information about the Scummvm-git-logs mailing list