mvdevs / jk2mv

JK2MV - improved, modernized JK2 client and server
https://jk2mv.org
GNU General Public License v2.0
108 stars 33 forks source link

PowerPC 32-bit Compile Fails #131

Closed HadetTheUndying closed 4 years ago

HadetTheUndying commented 4 years ago
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- JK2MV Version: 1.4-183-gb44a99b
-- Architecture is ppc
CMake Warning at CMakeLists.txt:149 (message):
  Building for unsupported Architecture ppc.

-- JK2MV SDK Version: 1.0.1-54-gb70c320
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") 
-- Found MiniZip: /usr/lib/libminizip.so
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include  
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  src/CMakeLists.txt:283 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Found OpenAL: /usr/lib/libopenal.so  
-- Found SDL2: /usr/lib/libSDL2main.a;/usr/lib/libSDL2.so;-lpthread  
-- Found JPEG: /usr/lib/libjpeg.so  
-- Found PNG: /usr/lib/libpng.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hadet/jk2mv/build/Linux-ppc-debug
make[1]: Entering directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
make[2]: Entering directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
Scanning dependencies of target mongoose
make[2]: Leaving directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
make[2]: Entering directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
[  0%] Building C object libs/mongoose/CMakeFiles/mongoose.dir/mongoose.c.o
/home/hadet/jk2mv/libs/mongoose/mongoose.c: In function 'mg_do_ssi_include':
/home/hadet/jk2mv/libs/mongoose/mongoose.c:9513:40: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
 9513 |     snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
      |                                        ^
/home/hadet/jk2mv/libs/mongoose/mongoose.c:9513:5: note: 'snprintf' output 2 or more bytes (assuming 4097) into a destination of size 4096
 9513 |     snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  0%] Linking C static library ../../out/Debug/libmongoose.a
make[2]: Leaving directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
[  0%] Built target mongoose
make[2]: Entering directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
Scanning dependencies of target jk2mvmenu_ppc
make[2]: Leaving directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
make[2]: Entering directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
[  0%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/ui/ui_main.c.o
[  0%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/ui/ui_atoms.c.o
[  0%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/ui/ui_force.c.o
[  1%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/ui/ui_gameinfo.c.o
[  1%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/ui/ui_shared.c.o
[  1%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/ui/ui_multiversion.c.o
[  1%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/game/bg_misc.c.o
[  2%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/game/bg_weapons.c.o
[  2%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/game/q_math.c.o
[  2%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/game/q_shared.c.o
[  2%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/ui/ui_multiversion_syscalls.c.o
[  3%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/game/bg_multiversion.c.o
[  3%] Building C object src/CMakeFiles/jk2mvmenu_ppc.dir/mvsdk/code/ui/ui_syscalls.c.o
[  3%] Linking C shared library ../out/Debug/jk2mvmenu_ppc.so
make[2]: Leaving directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
[  3%] Built target jk2mvmenu_ppc
make[2]: Entering directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
Scanning dependencies of target q3asm
make[2]: Leaving directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
make[2]: Entering directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
[  3%] Building C object src/mvsdk/tools/asm/CMakeFiles/q3asm.dir/cmdlib.c.o
/home/hadet/jk2mv/src/mvsdk/tools/asm/cmdlib.c: In function 'SetQdirFromPath':
/home/hadet/jk2mv/src/mvsdk/tools/asm/cmdlib.c:258:19: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
  258 |    for ( i = 0; i < strlen( qdir ); i++ )
      |                   ^
/home/hadet/jk2mv/src/mvsdk/tools/asm/cmdlib.c:271:21: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
  271 |      for ( i = 0; i < strlen( gamedir ); i++ )
      |                     ^
/home/hadet/jk2mv/src/mvsdk/tools/asm/cmdlib.c: In function 'ExpandPathAndArchive':
/home/hadet/jk2mv/src/mvsdk/tools/asm/cmdlib.c:347:31: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
  347 |   sprintf (archivename, "%s/%s", archivedir, path);
      |                               ^
/home/hadet/jk2mv/src/mvsdk/tools/asm/cmdlib.c:347:3: note: 'sprintf' output 2 or more bytes (assuming 1025) into a destination of size 1024
  347 |   sprintf (archivename, "%s/%s", archivedir, path);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  4%] Building C object src/mvsdk/tools/asm/CMakeFiles/q3asm.dir/q3asm.c.o
In file included from /home/hadet/jk2mv/src/mvsdk/tools/asm/q3asm.c:23:
/home/hadet/jk2mv/src/mvsdk/tools/asm/../qcommon/q_platform.h:319:2: error: #error "Architecture not supported"
  319 | #error "Architecture not supported"
      |  ^~~~~
/home/hadet/jk2mv/src/mvsdk/tools/asm/q3asm.c: In function 'InitTables':
/home/hadet/jk2mv/src/mvsdk/tools/asm/q3asm.c:1302:18: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
 1302 |  for ( i = 0 ; i < NUM_SOURCE_OPS ; i++ ) {
      |                  ^
/home/hadet/jk2mv/src/mvsdk/tools/asm/q3asm.c: In function 'WriteVmFile':
/home/hadet/jk2mv/src/mvsdk/tools/asm/q3asm.c:1400:19: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
 1400 |   for ( i = 0 ; i < sizeof( vmHeader_t ) / 4 ; i++ ) {
      |                   ^
make[2]: *** [src/mvsdk/tools/asm/CMakeFiles/q3asm.dir/build.make:76: src/mvsdk/tools/asm/CMakeFiles/q3asm.dir/q3asm.c.o] Error 1
make[2]: Leaving directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
make[1]: *** [CMakeFiles/Makefile2:563: src/mvsdk/tools/asm/CMakeFiles/q3asm.dir/all] Error 2
make[1]: Leaving directory '/home/hadet/jk2mv/build/Linux-ppc-debug'
make: *** [Makefile:152: all] Error 2
aufau commented 4 years ago

Hi, thanks for the report.

The error log says "architecture not supported" many times. PPC preprocessor macros in the code are a leftover from id tech 3, but it was never supported in jedi knight engines.

I can't imagine anyone from the current development team willing to work on adding support for it, PPC being an obsolete architecture.

I would gladly accept patches enabling it, but it's not landing on our roadmap.

Just beware, making it work on PPC is harder than fixing few compiler errors because JK2 code on top of id tech 3 has no concern for endianness (older q3 code should work fine). Also performance may be bad due to unaligned memory access in some places (these are handled by hardware interrupts on ppc iirc so slow)

HadetTheUndying commented 4 years ago

I'll take a crack at it. I have a copy of the OSX ppc port if all else fails, I'll dual boot.

aufau commented 4 years ago

In this case, I see your build stopped when compiling mvsdk - better try to compile the engine first, it will work with existing/retail .qvm mods anyway (interpreted, although JIT compiler could be ported from q3 or ioq3). You can just remove mvsdk directory/git submodule or disable it in cmake options.

Both Clang and GCC are supported if you are compiling on mac.

If you need any help, it's easiest to get it on jk2 discord: https://discord.gg/KFaeCpR

HadetTheUndying commented 4 years ago

I'm gonna go ahead and close this, as I don't have time to work on it right now, and I'm pretty sure I'm the only person with this issue currently.