Interrupt / systemshock

Shockolate - A minimalist and cross platform System Shock source port.
GNU General Public License v3.0
802 stars 62 forks source link

Build fails on aarch64 Manjaro Linux (arch) #347

Open DoktorCranium opened 4 years ago

DoktorCranium commented 4 years ago

Hello,

Using Manjaro (arch) Linux aarch64 cmake 3.16.2 gcc 9.2.0 make 4.2.1

after running the included build_deps.sh and successful cmake . I get the following error

Scanning dependencies of target 3D_LIB [ 82%] Building C object src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/alloc.c.o [ 83%] Building C object src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/Bitmap.c.o [ 83%] Building C object src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/clip.c.o [ 83%] Building C object src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/detail.c.o [ 83%] Building C object src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/fov.c.o [ 84%] Building C object src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/GlobalV.c.o [ 84%] Building C object src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/instance.c.o [ 84%] Building C object src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/interp.c.o /home/user/SRC/systemshock/src/Libraries/3D/Source/interp.c: In function ‘do_getparms’: /home/user/SRC/systemshock/src/Libraries/3D/Source/interp.c:869:29: error: invalid operands to binary + (have ‘va_list’ {aka ‘__va_list’} and ‘int’) 869 src = (long )(parm_ptr + ((unsigned short *)(opcode + 4))); ^ ~~~~~~~~~
short unsigned int
/home/user/SRC/systemshock/src/Libraries/3D/Source/interp.c: In function ‘do_getparms_i’: /home/user/SRC/systemshock/src/Libraries/3D/Source/interp.c:887:29: error: invalid operands to binary + (have ‘va_list’ {aka ‘__va_list’} and ‘int’) 887 src = (long )(parm_ptr + ((unsigned short *)(opcode + 4))); ^ ~~~~~~~~~
short unsigned int

make[2]: [src/Libraries/CMakeFiles/3D_LIB.dir/build.make:154: src/Libraries/CMakeFiles/3D_LIB.dir/3D/Source/interp.c.o] Error 1 make[1]: [CMakeFiles/Makefile2:308: src/Libraries/CMakeFiles/3D_LIB.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

The same code builds just fine on Ubuntu 18.04 x86_64

donnierussellii commented 4 years ago

The va_list type is probably implemented differently between the two distros' C libraries.

donnierussellii commented 4 years ago

va_list is only supposed to be used with the other va_macros. The code assumes we're adding an integer offset to a stack ptr. This should be rewritten compliant with stdarg.

donnierussellii commented 3 years ago

Fix in my PR #378