lynx Posted June 2, 2021 Share Posted June 2, 2021 The GemRB team is proud to announce a new release. Check out the details here: https://gemrb.org/2021/06/02/gemrb-0-8-8-released.html Quote Link to comment
Nugrud Posted June 4, 2021 Share Posted June 4, 2021 (edited) Neither 0.8.8 nor the newest git are building for me anymore on Manjaro linux with the same error on make: [ 46%] Linking CXX shared library libgemrb_core.so /usr/bin/ld: CMakeFiles/gemrb_core.dir/RNG.cpp.o: relocation R_X86_64_TPOFF32 against `_ZGVZN5GemRB3RNG11getInstanceEvE8instance' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: CMakeFiles/gemrb_core.dir/Scriptable/Actor.cpp.o: warning: relocation against `_ZN5GemRB8skillracE' in read-only section `.text' /usr/bin/ld: CMakeFiles/gemrb_core.dir/ActorMgr.cpp.o: relocation R_X86_64_PC32 against symbol `_ZTVN5GemRB8ActorMgrE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status make[2]: *** [gemrb/core/CMakeFiles/gemrb_core.dir/build.make:2136: gemrb/core/libgemrb_core.so.0.8.8-git] Error 1 make[1]: *** [CMakeFiles/Makefile2:1131: gemrb/core/CMakeFiles/gemrb_core.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 Edited June 4, 2021 by Nugrud Quote Link to comment
lynx Posted June 4, 2021 Author Share Posted June 4, 2021 Have you tried in a fresh build dir? Quote Link to comment
Nugrud Posted June 4, 2021 Share Posted June 4, 2021 yes, all fresh; I only pass -DLAYOUT and -DPREFIX to cmake; cmake's version is 3.20.2 and of gcc 10.2.0. Quote Link to comment
lynx Posted June 4, 2021 Author Share Posted June 4, 2021 (edited) Are you manually setting any CXXFLAGS? You can see the end effect by running make VERBOSE=1 in my case, extracting the flags: Quote -fPIC -Werror -Wno-error=inline -Wno-error=cast-align -Wmissing-declarations -Wno-error=deprecated-register -Wall -W -Wpointer-arith -pedantic -Wno-format-y2k -Wno-long-long -fsigned-char -fvisibility=hidden -fno-stack-protector -fno-strict-aliasing -g -Wl,--no-undefined -shared Edited June 4, 2021 by lynx Quote Link to comment
Nugrud Posted June 5, 2021 Share Posted June 5, 2021 I didn't set manually any flags, and apparently cmake didn't set any either?! gemrb (master)> mkdir build gemrb (master)> cd build/ build (master)> cmake -DLAYOUT=home -DPREFIX=/storage3/games/gemrb-bin/ .. -- The C compiler identification is unknown -- The CXX compiler identification is unknown -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detected version: 0.8.8-git -- Git version bool: 1 -- Found PythonLibs: /usr/lib/libpython2.7.so (found suitable version "2.7.18", minimum required is "2.3") -- Looking for Python libraries and headers: found -- Autodetecting SDL backend... -- 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 SDL: /usr/lib/libSDL.so;-lpthread (found version "1.2.15") -- Found SDL2: /usr/lib/libSDL2.so;-lpthread -- Found SDL 1.2, switching to SDL backend. -- Found SDL 2.0, switching to SDL2 backend. -- Found SDL2_mixer: /usr/lib/libSDL2_mixer.so (found version "2.0.4") -- Looking for SDL: found -- Looking for libSDL: found -- Looking for SDL_mixer: found -- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") -- Looking for Zlib: found -- Found OpenAL: /usr/lib/libopenal.so -- Looking for OpenAL: found -- Found LibVLC include-dir path: /usr/include -- Found LibVLC library path:/lib/libvlc.so -- Found LibVLCcore library path:/lib/libvlccore.so -- Looking for VLC: found -- Found Freetype: /usr/lib/libfreetype.so (found version "2.10.4") -- Looking for Freetype: found -- Looking for iconv_open -- Looking for iconv_open - found -- Performing Test ICONV_COMPILES -- Performing Test ICONV_COMPILES - Success -- Found ICONV: In glibc -- Found ICONV includes: /usr/include -- One (and only one) of the ICONV_ACCEPTS_... tests must pass -- Performing Test ICONV_ACCEPTS_NONCONST_INPUT -- Performing Test ICONV_ACCEPTS_NONCONST_INPUT - Success -- Performing Test ICONV_ACCEPTS_CONST_INPUT -- Performing Test ICONV_ACCEPTS_CONST_INPUT - Failed -- Found PNG: /usr/lib/libpng.so (found version "1.6.37") -- Looking for libPNG: found -- Looking for Ogg Vorbis support: found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of int -- Check size of int - done -- Check size of long int -- Check size of long int - done -- Check size of uint64_t -- Check size of uint64_t - done -- Check size of ssize_t -- Check size of ssize_t - done -- Looking for strndup -- Looking for strndup - found -- Looking for strlcpy -- Looking for strlcpy - not found -- Looking for setenv -- Looking for setenv - found -- Looking for ldexpf -- Looking for ldexpf - found -- Looking for realpath -- Looking for realpath - found -- Looking for mmap -- Looking for mmap - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file malloc.h -- Looking for include file malloc.h - found -- Looking for include file langinfo.h -- Looking for include file langinfo.h - found -- Looking for _aligned_malloc -- Looking for _aligned_malloc - not found -- Looking for memalign -- Looking for memalign - found -- Looking for posix_memalign -- Looking for posix_memalign - found -- Performing Test PERMITS_OBJECT_TO_FUNCTION_CAST -- Performing Test PERMITS_OBJECT_TO_FUNCTION_CAST - Failed -- -- These are the configured paths: -- PREFIX: /storage3/games/gemrb-bin/ -- LIB_DIR: /storage3/games/gemrb-bin/ -- PLUGIN_DIR: /storage3/games/gemrb-bin//plugins/ -- BIN_DIR: /storage3/games/gemrb-bin/ -- DATA_DIR: /storage3/games/gemrb-bin/ -- MAN_DIR: /storage3/games/gemrb-bin//man/man6 -- SYSCONF_DIR: /storage3/games/gemrb-bin/ -- DOC_DIR: /storage3/games/gemrb-bin//doc -- ICON_DIR: /storage3/games/gemrb-bin/ -- SVG_DIR: /storage3/games/gemrb-bin/ -- MENU_DIR: /storage3/games/gemrb-bin/ -- -- Options: -- LAYOUT: home -- NOCOLOR: disabled -- STATIC_LINK: disabled -- INSOURCEBUILD: disabled -- DISABLE_WERROR: disabled -- WIN32_USE_STDIO: disabled -- SDL_BACKEND: SDL2 -- OPENGL_BACKEND: None -- -- Build type: RelWithDebInfo -- Target bitness: 8*8 -- -- Compiler warnings are fatal. -- If you hit one, let us know and rerun cmake with -DDISABLE_WERROR=1 to continue. -- -- Configuring done CMake Warning (dev) at CMakeLists.txt:512 (ADD_LIBRARY): Policy CMP0115 is not set: Source file extensions must be explicit. Run "cmake --help-policy CMP0115" for policy details. Use the cmake_policy command to set the policy and suppress this warning. File: /storage3/games/gemrb/gemrb/plugins/BAMImporter/BAMFontManager.cpp Call Stack (most recent call first): gemrb/plugins/BAMImporter/CMakeLists.txt:1 (ADD_GEMRB_PLUGIN) This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: /storage3/games/gemrb/build build (master)> make VERBOSE=1 /usr/bin/cmake -S/storage3/games/gemrb -B/storage3/games/gemrb/build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /storage3/games/gemrb/build/CMakeFiles /storage3/games/gemrb/build//CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[1]: Entering directory '/storage3/games/gemrb/build' make -f gemrb/core/CMakeFiles/gemrb_core.dir/build.make gemrb/core/CMakeFiles/gemrb_core.dir/depend make[2]: Entering directory '/storage3/games/gemrb/build' cd /storage3/games/gemrb/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /storage3/games/gemrb /storage3/games/gemrb/gemrb/core /storage3/games/gemrb/build /storage3/games/gemrb/build/gemrb/core /storage3/games/gemrb/build/gemrb/core/CMakeFiles/gemrb_core.dir/DependInfo.cmake --color= Dependee "/storage3/games/gemrb/build/gemrb/core/CMakeFiles/gemrb_core.dir/DependInfo.cmake" is newer than depender "/storage3/games/gemrb/build/gemrb/core/CMakeFiles/gemrb_core.dir/depend.internal". Dependee "/storage3/games/gemrb/build/gemrb/core/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/storage3/games/gemrb/build/gemrb/core/CMakeFiles/gemrb_core.dir/depend.internal". Scanning dependencies of target gemrb_core make[2]: Leaving directory '/storage3/games/gemrb/build' make -f gemrb/core/CMakeFiles/gemrb_core.dir/build.make gemrb/core/CMakeFiles/gemrb_core.dir/build make[2]: Entering directory '/storage3/games/gemrb/build' [ 1%] Building CXX object gemrb/core/CMakeFiles/gemrb_core.dir/ActorMgr.cpp.o cd /storage3/games/gemrb/build/gemrb/core && /usr/bin/c++ -DGEM_BUILD_DLL -DHAVE_CONFIG_H -Dgemrb_core_EXPORTS -I/storage3/games/gemrb/build -I/storage3/games/gemrb/gemrb/includes -I/storage3/games/gemrb/gemrb/core -UNDEBUG -o CMakeFiles/gemrb_core.dir/ActorMgr.cpp.o -c /storage3/games/gemrb/gemrb/core/ActorMgr.cpp [ 1%] Building CXX object gemrb/core/CMakeFiles/gemrb_core.dir/Ambient.cpp.o cd /storage3/games/gemrb/build/gemrb/core && /usr/bin/c++ -DGEM_BUILD_DLL -DHAVE_CONFIG_H -Dgemrb_core_EXPORTS -I/storage3/games/gemrb/build -I/storage3/games/gemrb/gemrb/includes -I/storage3/games/gemrb/gemrb/core -UNDEBUG -o CMakeFiles/gemrb_core.dir/Ambient.cpp.o -c /storage3/games/gemrb/gemrb/core/Ambient.cpp Quote Link to comment
lynx Posted June 5, 2021 Author Share Posted June 5, 2021 Something looks wrong with your toolchains, as they're not getting recognized: Quote -- The C compiler identification is unknown -- The CXX compiler identification is unknown Try running with CC=gcc CXX=g++-10 cmake .. (or however the gcc and g++ binaries are named for you) Quote Link to comment
Nugrud Posted June 5, 2021 Share Posted June 5, 2021 (edited) It didn't help. CMakeError.log begins and contains many of such messages: Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/bin/gcc Build flags: Id flags: The output was: 1 CMakeCCompilerId.c:299:10: error: macro names must be identifiers 299 | # define /storage3/games/gemrb-bin/COMPILER_VERSION_MAJOR DEC(__GNUC__) | ^ CMakeCCompilerId.c:301:11: error: macro names must be identifiers 301 | # define /storage3/games/gemrb-bin/COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) | ^ CMakeCCompilerId.c:304:11: error: macro names must be identifiers 304 | # define /storage3/games/gemrb-bin/COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) | ^ Removing -DLAYOUT from the command makes cmake recognizing gcc and g++, but it still contains the message that compile warnings are fatal: build (master)> cmake -DLAYOUT=home .. -- The C compiler identification is GNU 10.2.0 -- The CXX compiler identification is GNU 10.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detected version: 0.8.8-git -- Git version bool: 1 -- Performing Test NO_STRINGOP_TRUNCATION -- Performing Test NO_STRINGOP_TRUNCATION - Success -- Performing Test VISIBILITY_HIDDEN -- Performing Test VISIBILITY_HIDDEN - Success -- Performing Test STACK_PROTECTOR -- Performing Test STACK_PROTECTOR - Success -- Performing Test FALLTHROUGH -- Performing Test FALLTHROUGH - Success -- Found PythonLibs: /usr/lib/libpython2.7.so (found suitable version "2.7.18", minimum required is "2.3") -- Looking for Python libraries and headers: found -- Autodetecting SDL backend... -- 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 SDL: /usr/lib/libSDL.so;-lpthread (found version "1.2.15") -- Found SDL2: /usr/lib/libSDL2.so;-lpthread -- Found SDL 1.2, switching to SDL backend. -- Found SDL 2.0, switching to SDL2 backend. -- Found SDL2_mixer: /usr/lib/libSDL2_mixer.so (found version "2.0.4") -- Looking for SDL: found -- Looking for libSDL: found -- Looking for SDL_mixer: found -- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") -- Looking for Zlib: found -- Found OpenAL: /usr/lib/libopenal.so -- Looking for OpenAL: found -- Found LibVLC include-dir path: /usr/include -- Found LibVLC library path:/lib/libvlc.so -- Found LibVLCcore library path:/lib/libvlccore.so -- Looking for VLC: found -- Found Freetype: /usr/lib/libfreetype.so (found version "2.10.4") -- Looking for Freetype: found -- Looking for iconv_open -- Looking for iconv_open - found -- Performing Test ICONV_COMPILES -- Performing Test ICONV_COMPILES - Success -- Found ICONV: In glibc -- Found ICONV includes: /usr/include -- One (and only one) of the ICONV_ACCEPTS_... tests must pass -- Performing Test ICONV_ACCEPTS_NONCONST_INPUT -- Performing Test ICONV_ACCEPTS_NONCONST_INPUT - Success -- Performing Test ICONV_ACCEPTS_CONST_INPUT -- Performing Test ICONV_ACCEPTS_CONST_INPUT - Failed -- Found PNG: /usr/lib/libpng.so (found version "1.6.37") -- Looking for libPNG: found -- Looking for Ogg Vorbis support: found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of int -- Check size of int - done -- Check size of long int -- Check size of long int - done -- Check size of uint64_t -- Check size of uint64_t - done -- Check size of ssize_t -- Check size of ssize_t - done -- Looking for strndup -- Looking for strndup - found -- Looking for strlcpy -- Looking for strlcpy - not found -- Looking for setenv -- Looking for setenv - found -- Looking for ldexpf -- Looking for ldexpf - found -- Looking for realpath -- Looking for realpath - found -- Looking for mmap -- Looking for mmap - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file malloc.h -- Looking for include file malloc.h - found -- Looking for include file langinfo.h -- Looking for include file langinfo.h - found -- Looking for _aligned_malloc -- Looking for _aligned_malloc - not found -- Looking for memalign -- Looking for memalign - found -- Looking for posix_memalign -- Looking for posix_memalign - found -- Performing Test HAS_OBJALIGN4 -- Performing Test HAS_OBJALIGN4 - Success -- Performing Test PERMITS_OBJECT_TO_FUNCTION_CAST -- Performing Test PERMITS_OBJECT_TO_FUNCTION_CAST - Failed -- -- These are the configured paths: -- PREFIX: /usr/local -- LIB_DIR: /usr/local -- PLUGIN_DIR: /usr/local/plugins/ -- BIN_DIR: /usr/local -- DATA_DIR: /usr/local -- MAN_DIR: /usr/local/man/man6 -- SYSCONF_DIR: /usr/local -- DOC_DIR: /usr/local/doc -- ICON_DIR: /usr/local -- SVG_DIR: /usr/local -- MENU_DIR: /usr/local -- -- Options: -- LAYOUT: home -- NOCOLOR: disabled -- STATIC_LINK: disabled -- INSOURCEBUILD: disabled -- DISABLE_WERROR: disabled -- WIN32_USE_STDIO: disabled -- SDL_BACKEND: SDL2 -- OPENGL_BACKEND: None -- -- Build type: RelWithDebInfo -- Target bitness: 8*8 -- -- Compiler warnings are fatal. -- If you hit one, let us know and rerun cmake with -DDISABLE_WERROR=1 to continue. CMakeError.log: Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: /storage3/games/gemrb/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make -f Makefile cmTC_0f99e/fast && /usr/bin/make -f CMakeFiles/cmTC_0f99e.dir/build.make CMakeFiles/cmTC_0f99e.dir/build make[1]: Entering directory '/storage3/games/gemrb/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_0f99e.dir/src.c.o /usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_0f99e.dir/src.c.o -c /storage3/games/gemrb/build/CMakeFiles/CMakeTmp/src.c Linking C executable cmTC_0f99e /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0f99e.dir/link.txt --verbose=1 /usr/bin/cc -rdynamic CMakeFiles/cmTC_0f99e.dir/src.c.o -o cmTC_0f99e /usr/bin/ld: CMakeFiles/cmTC_0f99e.dir/src.c.o: in function `main': src.c:(.text+0x3e): undefined reference to `pthread_create' /usr/bin/ld: src.c:(.text+0x4a): undefined reference to `pthread_detach' /usr/bin/ld: src.c:(.text+0x56): undefined reference to `pthread_cancel' /usr/bin/ld: src.c:(.text+0x67): undefined reference to `pthread_join' collect2: error: ld returned 1 exit status make[1]: *** [CMakeFiles/cmTC_0f99e.dir/build.make:99: cmTC_0f99e] Error 1 make[1]: Leaving directory '/storage3/games/gemrb/build/CMakeFiles/CMakeTmp' make: *** [Makefile:127: cmTC_0f99e/fast] Error 2 Source file was: #include <pthread.h> static void* test_func(void* data) { return data; } int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(thread); pthread_cancel(thread); pthread_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL); return 0; } Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /storage3/games/gemrb/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make -f Makefile cmTC_d9816/fast && /usr/bin/make -f CMakeFiles/cmTC_d9816.dir/build.make CMakeFiles/cmTC_d9816.dir/build make[1]: Entering directory '/storage3/games/gemrb/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_d9816.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_d9816.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.20/Modules/CheckFunctionExists.c Linking C executable cmTC_d9816 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d9816.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_d9816.dir/CheckFunctionExists.c.o -o cmTC_d9816 -lpthreads /usr/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status make[1]: *** [CMakeFiles/cmTC_d9816.dir/build.make:99: cmTC_d9816] Error 1 make[1]: Leaving directory '/storage3/games/gemrb/build/CMakeFiles/CMakeTmp' make: *** [Makefile:127: cmTC_d9816/fast] Error 2 (...) Edited June 5, 2021 by Nugrud Quote Link to comment
lynx Posted June 5, 2021 Author Share Posted June 5, 2021 Those are cmake-internal tests, nothing wrong with those error. Check the log to verify: Quote -- 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 As for "compile warnings are fatal" — well, you didn't disable that, so that's to be expected. So my only current question is, does it compile and link fine when you ensure proper compilers are identified like above? Quote Link to comment
Nugrud Posted June 5, 2021 Share Posted June 5, 2021 It compiles properly when -DPREFIX path does not begin with "/" sign, but then the path is rubbish. Quote Link to comment
lynx Posted June 6, 2021 Author Share Posted June 6, 2021 Can you try using CMAKE_INSTALL_PREFIX instead? PREFIX is an internal cmake variable, so maybe something goes wrong because of that. We try to be smart about this old shorthand, but perhaps that's not enough. Quote Link to comment
Nugrud Posted June 6, 2021 Share Posted June 6, 2021 Yes, CMAKE_INSTALL_PREFIX did work, thx! Quote Link to comment
lynx Posted June 6, 2021 Author Share Posted June 6, 2021 Great, will make it fatal then! Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.