xu4-engine/u4

Building xu4 on aarch64 devuan

Closed this issue · 2 comments

Glad you're reviving. What uses -gstabs?
./configure --sdl make make -C src -f Makefile make[1]: Entering directory '/media/sd/pcbak2/Projects/games/u4/src' cc -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"1.1svn\" -ggdb1 -rdynamic -g -O0 -fno-inline -fno-eliminate-unused-debug-types -gstabs -g3 -c -o lzw/hash.o lzw/hash.c cc1: error: target system does not support the ‘stabs’ debug format

DEBUGCXXFLAGS=-ggdb1 -rdynamic -g -O0 -fno-inline -fno-eliminate-unused-debug-types -gstabs -g3

Removing -gstabs from Makefile gets me through most of the compile but then, ... ambush!

g++ -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"1.1svn\" -ggdb1 -rdynamic -g -O0 -fno-inline -fno-eliminate-unused-debug-types -g -g3 -O2 -march=native -mcpu=native -mtune=native -ffast-math -ftree-vectorize -fno-strict-overflow -funsafe-math-optimizations  -c -o util/dumpsavegame.o util/dumpsavegame.cpp
g++ -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"1.1svn\" -ggdb1 -rdynamic -g -O0 -fno-inline -fno-eliminate-unused-debug-types -g -g3  -o dumpsavegame util/dumpsavegame.o savegame.o
/usr/bin/ld: savegame.o: in function `UltimaSaveIds::alloc(int, int, Config*, Tileset const*)':
/media/sd/pcbak2/Projects/games/u4/src/savegame.cpp:421: undefined reference to `Config::internSymbols(unsigned short*, unsigned short, char const*)'
/usr/bin/ld: /media/sd/pcbak2/Projects/games/u4/src/savegame.cpp:428: undefined reference to `Tileset::getByName(unsigned short) const'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile.common:99: dumpsavegame] Error 1
make[1]: Leaving directory '/media/sd/pcbak2/Projects/games/u4/src'
make: *** [Makefile:13: src/u4] Error 2

savegame.cpp looks quite different to my other versions. Still I got an executeable somehow.

27160992 Jul  6 08:49 u4

symlinked my ultima4 dir to ./ultima4 and ran u4
it complained with

xu4: warning: Failed to open file u4u/charset.vga for reading.

Let's make this work with original tileset and not require vga ultima4upgrade
(available here) https://ultima4.ultimacodex.com/ultima-4-upgrade/


moving on...

xu4: warning: Failed to open file u4u/start.old for reading

Strace doesn't show u4 trying to load any start.old, just shows:

/pr/games/u4/src$ strace ./u4 2>&1 |grep -i start.old
write(2, "Failed to open file u4u/start.ol"..., 46Failed to open file u4u/start.old for reading.) = 46

/pr/games/u4/src$ ls -l  u4u/start.old ultima4/u4u/start.old
-rw-rw-rw- 1 6847 Apr 30  1999 u4u/start.old
-rw-r--r-- 1 6847 Jul  6 09:39 ultima4/u4u/start.old

Then there's this mysterious thing:

xu4: error: Unable to load image "borders"
09:39:56-Clort@Desktop:/pr/games/u4/src$ strace ./u4 2>&1 |grep -i borders
write(2, "Unable to load image \"borders\"", 30Unable to load image "borders") = 30

I know this is detail work but just thought I'd give the feedback. For now U4 works fine in SCUMMVM

Sorry for the slow response. The debug options are minimized in commit b96244d.
The dumpsavegame issue was fixed in commit b846312.

The quick work-around for not having u4upgrad.zip is to manually set video=EGA in xu4rc.

A fix for the issue is in commit 88fa055.