tx00100xt / SeriousSamClassic-VK

Open source game engine version developed by Croteam for Serious Sam Classic with Vulkan support (Windows, Linux, FreeBSD, OpenBSD, macOS, Raspberry Pi OS). Based on https://github.com/sultim-t/Serious-Engine-Vk and linux port https://github.com/icculus/Serious-Engine
GNU General Public License v2.0
104 stars 12 forks source link

32-bit builds not working for RPi4 #12

Closed dragon99919 closed 1 year ago

dragon99919 commented 1 year ago

Hey! I just tried to compile both of FE and SE on my RPi4 (vanilla Raspberry PI OS 32-bit) and I get these errors.

For FE:

/home/dragon99919/git/SeriousSamClassic-VK/SamTFE/Sources/Engine/Graphics/Gfx_wrapper.cpp: In function ‘void GFX_SetFunctionPointers(INDEX)’:

/home/dragon99919/git/SeriousSamClassic-VK/SamTFE/Sources/Engine/Graphics/Gfx_wrapper.cpp:940:31: error: invalid conversion from ‘void ()(INDEX, INDEX)’ {aka ‘void ()(int, int)’} to ‘void ()(INDEX, short unsigned int)’ {aka ‘void ()(int, short unsigned int)’} [-fpermissive] 940 gfxDrawElements = &svk_DrawElements; ^~~~~
void ()(INDEX, INDEX) {aka void ()(int, int)}

make[2]: *** [CMakeFiles/Engine.dir/build.make:1389: CMakeFiles/Engine.dir/Engine/Graphics/Gfx_wrapper.cpp.o] Error 1

and for SE the test program doesn't even wanna budge:

Will build with 'make -j4' ... please edit this script if incorrect.

  • rm -rf cmake-build
  • mkdir cmake-build
  • cd cmake-build
  • cp -vfr ../EntitiesMP/PlayerWeapons_old.es ../EntitiesMP/PlayerWeapons.es '../EntitiesMP/PlayerWeapons_old.es' -> '../EntitiesMP/PlayerWeapons.es'
  • '[' -n '' ']'
  • cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DUSE_I386_NASM_ASM=TRUE .. -DRPI4=TRUE -- The C compiler identification is GNU 10.2.1 -- The CXX compiler identification is GNU 10.2.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc - broken CMake Error at /usr/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message): The C compiler

    "/usr/bin/cc"

    is not able to compile a simple test program.

    It fails with the following output:

    Change Dir: /home/dragon99919/git/SeriousSamClassic-VK/SamTSE/Sources/cmake-build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake cmTC_4f387/fast && /usr/bin/gmake -f CMakeFiles/cmTC_4f387.dir/build.make CMakeFiles/cmTC_4f387.dir/build gmake[1]: Entering directory '/home/dragon99919/git/SeriousSamClassic-VK/SamTSE/Sources/cmake-build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_4f387.dir/testCCompiler.c.o /usr/bin/cc -m32 -o CMakeFiles/cmTC_4f387.dir/testCCompiler.c.o -c /home/dragon99919/git/SeriousSamClassic-VK/SamTSE/Sources/cmake-build/CMakeFiles/CMakeTmp/testCCompiler.c cc: error: unrecognized command-line option ‘-m32’; did you mean ‘-mbe32’? gmake[1]: [CMakeFiles/cmTC_4f387.dir/build.make:85: CMakeFiles/cmTC_4f387.dir/testCCompiler.c.o] Error 1 gmake[1]: Leaving directory '/home/dragon99919/git/SeriousSamClassic-VK/SamTSE/Sources/cmake-build/CMakeFiles/CMakeTmp' gmake: [Makefile:140: cmTC_4f387/fast] Error 2

    CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!

Any ideas what can I do about these?

tx00100xt commented 1 year ago
  • -- Check for working C compiler: /usr/bin/cc - broken CMake Error at /usr/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message): The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  • cc: error: unrecognized command-line option ‘-m32’; did you mean ‘-mbe32’?

and

  • DUSE_I386_NASM_ASM=TRUE

I think the problem is this. It is not logical to use assembler from another architecture. Try this command:

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS=-mbe32 -DCMAKE_CXX_FLAGS=-mbe32 -DUSE_I386_NASM_ASM=FALSE .. -DRPI4=TRUE

dragon99919 commented 1 year ago

Okay, so while the initial error for SE doesn't occur now, the compiler throws itself out of the window in the same place as in case of FE:

[ 82%] Building CXX object CMakeFiles/EngineMP.dir/Engine/Graphics/DrawPort.cpp.o [ 82%] Building CXX object CMakeFiles/EngineMP.dir/Engine/Graphics/Gfx_wrapper.cpp.o /home/dragon99919/git/SeriousSamClassic-VK/SamTSE/Sources/Engine/Graphics/Gfx_wrapper.cpp: In function ‘void GFX_SetFunctionPointers(INDEX)’: /home/dragon99919/git/SeriousSamClassic-VK/SamTSE/Sources/Engine/Graphics/Gfx_wrapper.cpp:940:31: error: invalid conversion from ‘void ()(INDEX, INDEX)’ {aka ‘void ()(int, int)’} to ‘void ()(INDEX, short unsigned int)’ {aka ‘void ()(int, short unsigned int)’} [-fpermissive] 940 gfxDrawElements = &svk_DrawElements; ^~~~~
void ()(INDEX, INDEX) {aka void ()(int, int)}

make[2]: [CMakeFiles/EngineMP.dir/build.make:1389: CMakeFiles/EngineMP.dir/Engine/Graphics/Gfx_wrapper.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:283: CMakeFiles/EngineMP.dir/all] Error 2 make: *** [Makefile:149: all] Error 2

tx00100xt commented 1 year ago

Change in

Sources/Engine/Graphics/Gfx_wrapper_Vulkan.cpp static void svk_DrawElements(INDEX ctElem, INDEX *pidx)

to

static void svk_DrawElements(INDEX ctElem, INDEX_T *pidx)

dragon99919 commented 1 year ago

Cool, both builds are working now after this last fix, thx!