• Bug#1067207: mesa: switch statement too large, might need -mlong-jump-t

    From Thorsten Glaser@21:1/5 to All on Wed Mar 20 04:10:01 2024
    XPost: linux.debian.ports.68k, linux.debian.maint.x

    Source: mesa
    Version: 24.0.3-1
    Severity: important
    Justification: FTBFS on d-ports arch
    X-Debbugs-CC: tg@mirbsd.de, debian-68k@lists.debian.org
    Tags: ftbfs

    mesa currently FTBFS on m68k with:

    […]
    cc -Isrc/nouveau/headers/libnvidia_headers.a.p […] -o src/nouveau/headers/libnvidia_headers.a.p/meson-generated_.._nvk_cla097.c.o -c src/nouveau/headers/nvk_cla097.c
    /tmp/ccrcAVyk.s: Assembler messages:
    /tmp/ccrcAVyk.s:15766: Error: Adjusted signed .word (0x8002) overflows: `switch'-statement too large.
    /tmp/ccrcAVyk.s:15766: Error: Adjusted signed .word (0x8008) overflows: `switch'-statement too large.
    […]

    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’s needed, if it’s only a few and not expected to change, for example.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thorsten Glaser@21:1/5 to All on Sat Apr 6 09:52:23 2024
    XPost: linux.debian.ports.68k, linux.debian.maint.x

    retitle 1067207 mesa: [m68k] switch statement too large, needs -mlong-jump-table-offsets
    tags 1067207 + patch
    thanks

    Adding the -mlong-jump-table-offsets flag to CFLAGS on m68k should

    That did it. I built with…

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

    … in /etc/dpkg/buildflags.conf in the chroot. An equivalent patch
    for d/rules would be:

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

    export DEB_BUILD_MAINT_OPTIONS=optimize=-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 = \
    + $(shell DEB_CFLAGS_MAINT_APPEND='-Wall -mlong-jump-table-offsets' DEB_CXXFLAGS_MAINT_APPEND='-Wall -mlong-jump-table-offsets' dpkg-buildflags --export=configure)
    +else ifeq (,$(filter $(DEB_HOST_ARCH), armhf ppc64el sh3 sh4))
    buildflags = \
    $(shell DEB_CFLAGS_MAINT_APPEND=-Wall DEB_CXXFLAGS_MAINT_APPEND=-Wall dpkg-buildflags --export=configure)
    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~ 2024-04-01 23:29:11.000000000 +0200
    +++ debian/rules 2024-04-01 23:36:10.368947470 +0200
    @@ -18,20 +18,25 @@

    export D