Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: the runtime load version 17 is not compatible with this compiler 16 #15

Open
bugravirgomercury opened this issue Apr 2, 2021 · 9 comments

Comments

@bugravirgomercury
Copy link
Member

Trying to compile MulleObjC with mulle-clang 10.0.0 results in that error.

Command line:

$ cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX:PATH='/home/bugravirgomercury8/Desktop/objcthings/objcthings' \
      -DCMAKE_C_FLAGS="-I '/home/bugravirgomercury8/Desktop/objcthings/objcthings/include' -O3" \
      -DCMAKE_LIBRARY_PATH:PATH='/home/bugravirgomercury8/Desktop/objcthings/objcthings/lib'
-- The C compiler identification is Clang 10.0.0
-- Check for working C compiler: /home/bugravirgomercury8/Desktop/objcthings/mulle-clang/bin/mulle-clang
-- Check for working C compiler: /home/bugravirgomercury8/Desktop/objcthings/mulle-clang/bin/mulle-clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- MULLE_SDK_PATH=/home/bugravirgomercury8/Desktop/objcthings/MulleObjC/dependency;/home/bugravirgomercury8/Desktop/objcthings/MulleObjC/addiction
-- TMP_SDK_PATH=/home/bugravirgomercury8/Desktop/objcthings/MulleObjC/dependency
-- TMP_SDK_PATH=/home/bugravirgomercury8/Desktop/objcthings/MulleObjC/addiction
-- CMAKE_INCLUDE_PATH=""
-- CMAKE_LIBRARY_PATH="/home/bugravirgomercury8/Desktop/objcthings/objcthings/lib"
-- CMAKE_FRAMEWORK_PATH=""
-- INCLUDE_DIRS=""
-- CMAKE_PREFIX_PATH=""
-- CMAKE_INSTALL_PREFIX="/home/bugravirgomercury8/Desktop/objcthings/objcthings"
-- MULLE_OBJC_RUNTIME_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-objc-runtime.a
-- MULLE_DLFCN_HEADER is /home/bugravirgomercury8/Desktop/objcthings/objcthings/include/mulle-dlfcn/mulle-dlfcn.h
-- DL_LIBRARY is /usr/lib/x86_64-linux-gnu/libdl.so
-- MULLE_CONCURRENT_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-concurrent.a
-- MULLE_ABA_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-aba.a
-- MULLE_ALLOCATOR_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-allocator.a
-- MULLE_C11_HEADER is /home/bugravirgomercury8/Desktop/objcthings/objcthings/include/mulle-c11/mulle-c11.h
-- MULLE_THREAD_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-thread.a
-- PTHREADS_LIBRARY is /usr/lib/x86_64-linux-gnu/libpthread.so
-- /usr/lib/include/pthreads/cmake/DependenciesAndLibraries.cmake not found
-- /usr/lib/include/pthread/cmake/DependenciesAndLibraries.cmake not found
-- MULLE_VARARG_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-vararg.a
-- MULLE_STACKTRACE_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-stacktrace.a
-- MULLE_ATINIT_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-atinit.a
-- MULLE_ATEXIT_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-atexit.a
-- MULLE_DATA_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-data.a
-- MULLE_CONTAINER_LIBRARY is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib/libmulle-container.a
-- MULLE_OBJC_LOADER_TOOL is /home/bugravirgomercury8/Desktop/objcthings/objcthings/bin/mulle-objc-loader-tool
-- PUBLIC_HEADERS=src/MulleObjCCompiler.h;src/MulleObjCIntegralType.h;src/MulleObjCUniverse.h;src/MulleObjCVersion.h;src/MulleObjC.h;src/class/MulleObjCAutoreleasePool.h;src/class/MulleObjCLoader.h;src/class/NSAutoreleasePool.h;src/class/NSInvocation.h;src/class/NSLock.h;src/class/NSMethodSignature.h;src/class/NSObject+NSCodingSupport.h;src/class/NSObject.h;src/class/NSProxy.h;src/class/NSRecursiveLock.h;src/class/NSThread.h;src/function/MulleObjCAllocation.h;src/function/MulleObjCExceptionHandler.h;src/function/MulleObjCFunctions.h;src/function/MulleObjCHashFunctions.h;src/function/MulleObjCStackFrame.h;src/function/NSByteOrder.h;src/function/NSDebug.h;src/import.h;src/include.h;src/minimal.h;src/mulle-objc-classbit.h;src/mulle-objc-fastclassid.h;src/mulle-objc-fastmethodid.h;src/mulle-objc.h;src/mulle-objc-threadfoundationinfo.h;src/mulle-objc-type.h;src/protocol/MulleObjCClassCluster.h;src/protocol/MulleObjCException.h;src/protocol/MulleObjCProtocol.h;src/protocol/MulleObjCRuntimeObject.h;src/protocol/MulleObjCSingleton.h;src/protocol/MulleObjCTaggedPointer.h;src/protocol/NSCoding.h;src/protocol/NSContainer.h;src/protocol/NSCopying.h;src/protocol/NSEnumeration.h;src/protocol/NSLocking.h;src/protocol/NSMutableCopying.h;src/protocol/NSObjectProtocol.h;src/struct/MulleObjCContainerCallback.h;src/struct/NSRange.h;src/struct/NSZone.h
-- PRIVATE_HEADERS=src/class/NSMethodSignature-Private.h;src/function/MulleObjCExceptionHandler-Private.h;src/import-private.h;src/include-private.h;src/mulle-objc-autoreleasepointerarray-private.h;src/mulle-objc-exceptionhandlertable-private.h;src/mulle-objc-startup-private.inc;src/mulle-objc-universeconfiguration-private.h;src/mulle-objc-universefoundationinfo-private.h
-- PROJECT_INSTALLABLE_HEADERS=src/MulleObjCCompiler.h;src/MulleObjCIntegralType.h;src/MulleObjCUniverse.h;src/MulleObjCVersion.h;src/MulleObjC.h;src/class/MulleObjCAutoreleasePool.h;src/class/MulleObjCLoader.h;src/class/NSAutoreleasePool.h;src/class/NSInvocation.h;src/class/NSLock.h;src/class/NSMethodSignature.h;src/class/NSObject+NSCodingSupport.h;src/class/NSObject.h;src/class/NSProxy.h;src/class/NSRecursiveLock.h;src/class/NSThread.h;src/function/MulleObjCAllocation.h;src/function/MulleObjCExceptionHandler.h;src/function/MulleObjCFunctions.h;src/function/MulleObjCHashFunctions.h;src/function/MulleObjCStackFrame.h;src/function/NSByteOrder.h;src/function/NSDebug.h;src/import.h;src/include.h;src/minimal.h;src/mulle-objc-classbit.h;src/mulle-objc-fastclassid.h;src/mulle-objc-fastmethodid.h;src/mulle-objc.h;src/mulle-objc-threadfoundationinfo.h;src/mulle-objc-type.h;src/protocol/MulleObjCClassCluster.h;src/protocol/MulleObjCException.h;src/protocol/MulleObjCProtocol.h;src/protocol/MulleObjCRuntimeObject.h;src/protocol/MulleObjCSingleton.h;src/protocol/MulleObjCTaggedPointer.h;src/protocol/NSCoding.h;src/protocol/NSContainer.h;src/protocol/NSCopying.h;src/protocol/NSEnumeration.h;src/protocol/NSLocking.h;src/protocol/NSMutableCopying.h;src/protocol/NSObjectProtocol.h;src/struct/MulleObjCContainerCallback.h;src/struct/NSRange.h;src/struct/NSZone.h;src/reflect/_MulleObjC-import.h;src/reflect/_MulleObjC-include.h;src/class/NSMethodSignature-Private.h;src/function/MulleObjCExceptionHandler-Private.h;src/import-private.h;src/include-private.h;src/mulle-objc-autoreleasepointerarray-private.h;src/mulle-objc-exceptionhandlertable-private.h;src/mulle-objc-startup-private.inc;src/mulle-objc-universeconfiguration-private.h;src/mulle-objc-universefoundationinfo-private.h
-- OBJC_LOADER_INC is "/home/bugravirgomercury8/Desktop/objcthings/MulleObjC/src/reflect/objc-loader.inc"
-- INHERITED_OBJC_LOADERS is ""
-- CMAKE_MODULE_PATH is /home/bugravirgomercury8/Desktop/objcthings/MulleObjC/cmake;/home/bugravirgomercury8/Desktop/objcthings/MulleObjC/cmake/reflect;/home/bugravirgomercury8/Desktop/objcthings/MulleObjC/cmake/share
-- CMAKE_BUILD_TYPE is 
-- CMAKE_SYSTEM_NAME is Linux
-- BUILD_SHARED_LIBS is 
-- CMAKE_INCLUDE_PATH is 
-- CMAKE_LIBRARY_PATH is /home/bugravirgomercury8/Desktop/objcthings/objcthings/lib
-- MULLE_LANGUAGE is 
-- MULLE_C_COMPILER_ID is Clang
-- MULLE_CXX_COMPILER_ID is Clang
-- CMAKE_C_COMPILER_ID is Clang
-- CMAKE_C_FLAGS is -I '/home/bugravirgomercury8/Desktop/objcthings/objcthings/include' -O3  
-- CMAKE_CXX_COMPILER_ID is Clang
-- CMAKE_CXX_FLAGS is   
-- CMAKE_EXE_LINKER_FLAGS is 
-- CMAKE_SHARED_LINKER_FLAGS is 
-- CMAKE_STATIC_LINKER_FLAGS is 
-- CMAKE_INSTALL_RPATH="$ORIGIN/../lib"
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bugravirgomercury8/Desktop/objcthings/MulleObjC/build

$ cmake --build ./build --target install --config Release
Scanning dependencies of target _1_MulleObjC
[  3%] Building C object CMakeFiles/_1_MulleObjC.dir/src/class/NSAutoreleasePool.m.o
error: the runtime load version 17 is not compatible with this compiler 16
1 error generated.
make[2]: *** [CMakeFiles/_1_MulleObjC.dir/build.make:63: CMakeFiles/_1_MulleObjC.dir/src/class/NSAutoreleasePool.m.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/_1_MulleObjC.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

mulle-clang --version

mulle-clang 10.0.0.2 (runtime-load-version: 16) clang version 10.0.0 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/bugravirgomercury8/Desktop/objcthings/mulle-clang/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Selected multilib: .;@m64
@mulle-nat
Copy link
Member

mulle-nat commented Apr 3, 2021

It's basically as the error says, the compiler is too old. It shows runtime-load-version: 16 but 17 is required. So you need to upgrade the compiler. The runtime internal structs sometimes change and a matching compiler is required to produce these structs (like Classes or Methods)

@bugravirgomercury
Copy link
Member Author

bugravirgomercury commented Apr 4, 2021

Oh, I understand it now. I needed to double-check it as I just used the install-mulle-clang script to build mulle-clang recently. Guess the version numbers need to be updated there. Thanks for your help nonetheless 👍

@mulle-nat
Copy link
Member

mulle-nat commented Apr 4, 2021

Hmm, no. The version numbers should be consistent already in the projects. You need the proper projects, otherwise things go bad in very subtle ways. What might trip you up, as it did me on occasions, is, that the mulle-clang repository is no longer used and the compiler has to be built with the mulle-clang-project repository. That's because llvm changed to a mono-repo and I had to follow suite. Otherwise it would have become even more tedious, as it is already, to keep the mainline and the mulle-objc branch in sync.

@bugravirgomercury
Copy link
Member Author

bugravirgomercury commented Apr 4, 2021

Yeah, I missed the "superseded" notification at mulle-clang repository, guess I have to compile mulle-clang-project repository, which makes my computer unusable for a couple of hours. But I will take advantage of LTO+PGO this time. Maybe I can compile mulle-objc-runtime + MulleObjC with LTO maybe, for extra optimization. Thankfully, patience is one of my virtues.

@mulle-nat
Copy link
Member

mulle-nat commented Apr 4, 2021

I know the pain :) As I see CMAKE_SYSTEM_NAME is Linux you could take one of the prefabricated builds for Debian/Ubuntu. I think a dpkg is just a tar or cpio archive that unpacks into /opt (in the mulle-clang case) and adds some symlinks. That's maybe good enough for other linuxes as well, not sure though.

@bugravirgomercury
Copy link
Member Author

I actually tried the prefab builds first, but my distro needs to be updated (for glibc etc), and the updates haven't delivered yet, as new version of glibc is still being tested by distro manager. I'm using deepin btw :D So I build it from source, (and sleep on it).

@mulle-nat
Copy link
Member

If one could link glibc statically that would be a win :)

@bugravirgomercury
Copy link
Member Author

Yeah, definitely!

@mulle-nat
Copy link
Member

Is it working now for you ? Should I close this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants