Discussion:
Bug#1067207: mesa: switch statement too large, might need -mlong-jump-table-offsets
(too old to reply)
Thorsten Glaser
2024-03-20 03:10:01 UTC
Permalink
Source: mesa
Version: 24.0.3-1
Severity: important
Justification: FTBFS on d-ports arch
X-Debbugs-CC: ***@mirbsd.de, debian-***@lists.debian.org
Tags: ftbfs

mesa currently FTBFS on m68k with:

[=E2=80=A6]
cc -Isrc/nouveau/headers/libnvidia_headers.a.p [=E2=80=A6] -o src/nouveau/h=
eaders/libnvidia_headers.a.p/meson-generated_.._nvk_cla097.c.o -c src/nouve=
au/headers/nvk_cla097.c
/tmp/ccrcAVyk.s: Assembler messages:
/tmp/ccrcAVyk.s:15766: Error: Adjusted signed .word (0x8002) overflows: `sw=
itch'-statement too large.
/tmp/ccrcAVyk.s:15766: Error: Adjusted signed .word (0x8008) overflows: `sw=
itch'-statement too large.
[=E2=80=A6]

Not sure if it makes sense to exclude building this part of nouveau
on m68k (I do know someone who has added a PCI bus to his Atari and
runs a Radeon on it) or whether other files in this source package
also have huge jump tables.

Adding the -mlong-jump-table-offsets flag to CFLAGS on m68k should
unbreak this; bonus points if you add it to only the files where
it=E2=80=99s needed, if it=E2=80=99s only a few and not expected to change,=
for example.
Thorsten Glaser
2024-04-06 07:52:23 UTC
Permalink
retitle 1067207 mesa: [m68k] switch statement too large, needs -mlong-jump-=
table-offsets
tags 1067207 + patch
thanks
Post by Thorsten Glaser
Adding the -mlong-jump-table-offsets flag to CFLAGS on m68k should
That did it. I built with=E2=80=A6

APPEND CFLAGS -mlong-jump-table-offsets
APPEND CXXFLAGS -mlong-jump-table-offsets

=E2=80=A6 in /etc/dpkg/buildflags.conf in the chroot. An equivalent patch
for d/rules would be:

--- debian/rules~=092024-04-01 23:29:11.000000000 +0200
+++ debian/rules=092024-04-01 23:31:39.379936168 +0200
@@ -18,7 +18,11 @@

export DEB_BUILD_MAINT_OPTIONS=3Doptimize=3D-lto

-ifeq (,$(filter $(DEB_HOST_ARCH), armhf ppc64el sh3 sh4))
+ifneq (,$(filter $(DEB_HOST_ARCH), m68k))
+# This library has huge jump tables: Debian #1067207
+buildflags =3D \
+=09$(shell DEB_CFLAGS_MAINT_APPEND=3D'-Wall -mlong-jump-table-offsets' DEB=
_CXXFLAGS_MAINT_APPEND=3D'-Wall -mlong-jump-table-offsets' dpkg-buildflags =
--export=3Dconfigure)
+else ifeq (,$(filter $(DEB_HOST_ARCH), armhf ppc64el sh3 sh4))
buildflags =3D \
=09$(shell DEB_CFLAGS_MAINT_APPEND=3D-Wall DEB_CXXFLAGS_MAINT_APPEND=3D-Wa=
ll dpkg-buildflags --export=3Dconfigure)
else

While there, you might want to consider changing these
nested ifs to the new gmake else-if model or perhaps
sorting it, or even changing to something like:

--- debian/rules~=092024-04-01 23:29:11.000000000 +0200
+++ debian/rules=092024-04-01 23:36:10.368947470 +0200
@@ -18,20 +18,25 @@
=20
export DEB_BUILD_MAINT_OPTIONS=3Doptimize=3D-lto
=20
-ifeq (,$(filter $(DEB_HOST_ARCH), armhf ppc64el sh3 sh4))
-buildflags =3D \
-=09$(shell DEB_CFLAGS_MAINT_APPEND=3D-Wall DEB_CXXFLAGS_MAINT_APPEND=3D-Wa=
ll dpkg-buildflags --export=3Dconfigure)
-else
- ifneq (,$(filter $(DEB_HOST_ARCH), armhf))
- # Workaround for a variant of LP: #725126
- buildflags =3D \
-=09$(shell DEB_CFLAGS_MAINT_APPEND=3D"-Wall -fno-optimize-sibling-calls" D=
EB_CXXFLAGS_MAINT_APPEND=3D"-Wall -fno-optimize-sibling-calls" dpkg-buildfl=
ags --export=3Dconfigure)
- else
- # Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83143
- buildflags =3D \
-=09$(shell DEB_CFLAGS_MAINT_APPEND=3D"-Wall -O1" DEB_CXXFLAGS_MAINT_APPEND=
=3D"-Wall -O1" dpkg-buildflags --export=3Dconfigure)
- endif
+DEB_CFLAGS_MAINT_APPEND :=3D -Wall
+DEB_CXXFLAGS_MAINT_APPEND :=3D -Wall
+ifneq (,$(filter $(DEB_HOST_ARCH), armhf))
+# Workaround for a variant of LP: #725126
+DEB_CFLAGS_MAINT_APPEND +=3D -fno-optimize-sibling-calls
+DEB_CXXFLAGS_MAINT_APPEND +=3D -fno-optimize-sibling-calls
+else ifneq (,$(filter $(DEB_HOST_ARCH), m68k))
+# This library has huge jump tables: Debian #1067207
+DEB_CFLAGS_MAINT_APPEND +=3D -mlong-jump-table-offsets
+DEB_CXXFLAGS_MAINT_APPEND +=3D -mlong-jump-table-offsets
+else ifneq (,$(filter $(DEB_HOST_ARCH), ppc64el sh3 sh4))
+# Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83143
+DEB_CFLAGS_MAINT_APPEND +=3D -O1
+DEB_CXXFLAGS_MAINT_APPEND +=3D -O1
endif
+buildflags =3D $(shell \
+=09DEB_CFLAGS_MAINT_APPEND=3D'$(DEB_CFLAGS_MAINT_APPEND)' \
+=09DEB_CXXFLAGS_MAINT_APPEND=3D'$(DEB_CXXFLAGS_MAINT_APPEND)' \
+=09dpkg-buildflags --export=3Dconfigure)
=20
EGL_PLATFORMS =3D x11
GALLIUM_DRIVERS =3D swrast

bye,
//mirabilos
--=20
When he found out that the m68k port was in a pretty bad shape, he did
not, like many before him, shrug and move on; instead, he took it upon
himself to start compiling things, just so he could compile his shell.
How's that for dedication. -- Wouter, about my Debian/m68k revival
Loading...