Source: hatari Version: 2.4.1+dfsg-1 Severity: important Tags: ftbfs patch upstream Justification: fails to build from source (but built successfully in the past) User: debian-ri...@lists.debian.org Usertags: riscv64 X-Debbugs-Cc: i...@hack3r.moe, debian-ri...@lists.debian.org
Dear maintainer(s), hatari failed to build on riscv64 due to `REG_A0` macro being defined twice: ``` [ 4%] Building C object src/cpu/CMakeFiles/build68k.dir/writelog.c.o cd /<<PKGBUILDDIR>>/obj-riscv64-linux-gnu/src/cpu && /usr/bin/cc -DCONFDIR=\"/etc\" -I/<<PKGBUILDDIR>>/src/includes -I/<<PKGBUILDDIR>>/src/debug -I/<<PKGBUILDDIR>>/src/falcon -I/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu -I/usr/include/SDL2 -I/<<PKGBUILDDIR>>/src/cpu -I/<<PKGBUILDDIR>>/src/cpu/. -I/<<PKGBUILDDIR>>/src/cpu/../.. -I/<<PKGBUILDDIR>>/src/cpu/../includes -I/<<PKGBUILDDIR>>/src/cpu/softfloat -I/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu/src/cpu -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wcast-qual -Wbad-function-cast -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wall -Wwrite-strings -Wsign-compare -Wformat-security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wno-unused-variable -Wno-unused-function -Wno-unused-label -Wno-missing-braces -Wno-sign-compare -Wno-unused-but-set-variable -MD -MT src/cpu/CMakeFiles/build68k.dir/writelog.c.o -MF CMakeFiles/build68k.dir/writelog.c.o.d -o CMakeFiles/build68k.dir/writelog.c.o -c /<<PKGBUILDDIR>>/src/cpu/writelog.c In file included from /usr/include/signal.h:316, from /usr/include/SDL2/SDL_assert.h:65, from /usr/include/SDL2/SDL.h:34, from /<<PKGBUILDDIR>>/src/debug/debugui.c:16: /<<PKGBUILDDIR>>/src/includes/m68000.h:39:3: error: expected identifier before numeric constant 39 | REG_A0, /* A0.. */ | ^~~~~~ make[3]: *** [src/debug/CMakeFiles/Debug.dir/build.make:93: src/debug/CMakeFiles/Debug.dir/debugui.c.o] Error 1 make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-riscv64-linux-gnu' make[2]: *** [CMakeFiles/Makefile2:626: src/debug/CMakeFiles/Debug.dir/all] Error 2 make[2]: *** Waiting for unfinished jobs.... ``` Full buildd log: https://buildd.debian.org/status/fetch.php?pkg=hatari&arch=riscv64&ver=2.4.1%2Bdfsg-1&stamp=1663557982&raw=0 The fix had been included upstream in commit 952c5292 upstream, but removed for another fix (b13a6f18) that doesn't work on riscv64. I've included a patch that re-enables the fix. Tested on my qemu-system-riscv64 and works fine. If more help is needed, please let me know. Cheers, Eric
Description: Re-apply upstream hack so that REG_A0 is not defined twice on riscv64 Origin: upstream, commit 952c5292bf2fb9443b9686fe1d47c570915d63c5 --- a/src/includes/m68000.h +++ b/src/includes/m68000.h @@ -27,6 +27,10 @@ #include "log.h" +#ifdef REG_A0 /* REG_A0 can already be defined in RISC-V's header */ +#undef REG_A0 +#endif + /* 68000 register defines */ enum { REG_D0, /* D0.. */