scp-fs2open / fs2open.github.com

Origin Repository for SCP FreeSpace 2 Open
https://www.hard-light.net/
Other
407 stars 163 forks source link

Fails to build on ppc64 #2260

Closed pkubaj closed 4 years ago

pkubaj commented 4 years ago

Looks like big-endian code wasn't updated:

FAILED: code/CMakeFiles/code.dir/model/modelread.cpp.o 
/usr/bin/c++  -DNDEBUG -DROCKET_STATIC_LIB -DSCP_BSD -DSCP_UNIX -DUSE_OPENAL -D_REENTRANT -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -I/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code -I/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/freespace2 -Igenerated_source -Igenerated_source/code -I/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/lib/discord/src/../include -I/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/lib/libRocket/Include -I/usr/local/include/freetype2 -I/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/lib/mongoose -isystem /tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/lib/opengl/gl/glad/include -isystem /usr/local/include/AL -isystem /usr/local/include/lua51 -isystem /usr/local/include -isystem /usr/local/include/SDL2 -isystem /tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/lib/utfcpp -isystem /tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/lib/md5 -isystem /tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/lib/libpcp/include -isystem lib/jansson/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -W -Wall -Wextra -funroll-loops -fsigned-char -Wno-unknown-pragmas -fdiagnostics-color  -Wformat-security -Wreturn-type -Wno-char-subscripts -Wno-shift-negative-value -O2 -Wno-unused-variable -Wno-unused-parameter   -include/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/prefix_header.h -pthread -std=gnu++11 -MD -MT code/CMakeFiles/code.dir/model/modelread.cpp.o -MF code/CMakeFiles/code.dir/model/modelread.cpp.o.d -o code/CMakeFiles/code.dir/model/modelread.cpp.o -c /tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5347:22: error: use of undeclared identifier 'model_ptr'
        ubyte *p = (ubyte *)model_ptr;
                            ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5365:23: error: use of undeclared identifier 'pm'
                                swap_bsp_flatpoly(pm, p);
                                                  ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5368:23: error: use of undeclared identifier 'pm'
                                swap_bsp_tmappoly(pm, p);
                                                  ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5371:24: error: use of undeclared identifier 'pm'
                                swap_bsp_sortnorms(pm, p);
                                                   ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5403:26: error: use of undeclared identifier 'buffer'
        char *type_p = (char *)(buffer);
                                ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5404:24: error: use of undeclared identifier 'buffer'
        int *size_p = (int *)(buffer+1);
                              ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5408:29: error: use of undeclared identifier 'buffer'
        vec3d *minbox_p = (vec3d*)(buffer+5);
                                   ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5409:29: error: use of undeclared identifier 'buffer'
        vec3d *maxbox_p = (vec3d*)(buffer+17);
                                   ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5421:49: error: use of undeclared identifier 'buffer'
        unsigned int *front_offset_p = (unsigned int*)(buffer+29);
                                                       ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5422:48: error: use of undeclared identifier 'buffer'
        unsigned int *back_offset_p = (unsigned int*)(buffer+33);
                                                      ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5425:49: error: use of undeclared identifier 'buffer'
        unsigned int *num_polygons_p = (unsigned int*)(buffer+29);
                                                       ^
/tmp/usr/ports/games/fs2open/work/fs2open.github.com-release_19_0_0/code/model/modelread.cpp:5427:45: error: use of undeclared identifier 'buffer'
        unsigned int *shld_polys = (unsigned int*)(buffer+33);
                                                   ^
12 errors generated.
The-E commented 4 years ago

While we generally only support x86 and x86-64 as our platforms, we will definitely welcome patches to fix this issue. Please take a look at #2200, as it seems to be pretty much the same issue, and take note of the discussion there.

notimaginative commented 4 years ago

Actually I think this is just because the function variables are commented out in swap_bsp_data() and swap_sdlc_data(). There will be a compiler warning on little-endian systems because the variables are unused, so someone dealt with the warning without realizing they are needed on big-endian.