Skip to content

Commit 204b9eb

Browse files
committed
mame - fix linking on Raspberry Pi OS bullseye
Latest mame has an issue linking on Raspberry Pi OS Bullseye. It fails with /usr/bin/ld: BFD (GNU Binutils for Raspbian) 2.35.2 assertion fail ../../bfd/elf32-arm.c:9876 Work around this by using the gold linker.
1 parent 730b526 commit 204b9eb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scriptmodules/emulators/mame.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ function build_mame() {
4949
local params=(NOWERROR=1 ARCHOPTS=-U_FORTIFY_SOURCE PYTHON_EXECUTABLE=python3)
5050
# when building on ARM enable 'fsigned-char' for compiled code, fixes crashes in a few drivers
5151
isPlatform "arm" || isPlatform "aarch64" && params+=(ARCHOPTS_CXX=-fsigned-char)
52-
QT_SELECT=5 make "${params[@]}"
52+
53+
# workaround for linker crash on bullseye (use gold linker)
54+
if [[ "$__os_debian_ver" -eq 11 ]] && isPlatform "arm"; then
55+
QT_SELECT=5 LDFLAGS+=" -fuse-ld=gold -Wl,--long-plt" make "${params[@]}"
56+
else
57+
QT_SELECT=5 make "${params[@]}"
58+
fi
59+
5360
strip mame
5461

5562
rpSwap off

0 commit comments

Comments
 (0)