Retro68
Retro68 copied to clipboard
ResInfo fails to link on OS X Tiger (PPC)
Hello!
I am having trouble building retro68 on Mac OS X Tiger 10.4.11 (PowerPC). Installed xcode 2.5 and also all the required dependencies using tigerbrew, but I am stuck at this:
[ 66%] Building C object libelf/CMakeFiles/ELF.dir/src/gelf_xlatetom.c.o [ 66%] Building C object libelf/CMakeFiles/ELF.dir/src/next_prime.c.o [ 67%] Building C object libelf/CMakeFiles/ELF.dir/src/nlist.c.o [ 67%] Linking C static library libELF.a [ 67%] Built target ELF Scanning dependencies of target ResourceFiles [ 68%] Building CXX object ResourceFiles/CMakeFiles/ResourceFiles.dir/ResourceFork.cc.o [ 69%] Building CXX object ResourceFiles/CMakeFiles/ResourceFiles.dir/BinaryIO.cc.o [ 69%] Building CXX object ResourceFiles/CMakeFiles/ResourceFiles.dir/ResType.cc.o [ 70%] Building CXX object ResourceFiles/CMakeFiles/ResourceFiles.dir/ResourceFile.cc.o [ 70%] Linking CXX static library libResourceFiles.a [ 70%] Built target ResourceFiles Scanning dependencies of target ResInfo [ 71%] Building CXX object ResourceFiles/CMakeFiles/ResInfo.dir/ResInfo.cc.o [ 71%] Linking CXX executable ResInfo /usr/bin/ld: warning can't open dynamic library: @loader_path/libboost_system-mt.dylib referenced from: /usr/local/lib/libboost_filesystem-mt.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2) /usr/bin/ld: Undefined symbols: boost::system::system_category() referenced from libboost expected to be defined in @loader_path/libboost_system-mt.dylib boost::system::generic_category() referenced from libboost expected to be defined in @loader_path/libboost_system-mt.dylib collect2: error: ld returned 1 exit status make[2]: *** [ResourceFiles/ResInfo] Error 1 make[1]: *** [ResourceFiles/CMakeFiles/ResInfo.dir/all] Error 2 make: *** [all] Error 2 bluebox:/opt/retro68 alex$
However:
bluebox:/usr/local/lib alex$ file /usr/local/lib/libboost_filesystem-mt.dylib /usr/local/lib/libboost_filesystem-mt.dylib: symbolic link to `../Cellar/boost/1.58.0/lib/libboost_filesystem-mt.dylib'
bluebox:/usr/local/lib alex$ file ../Cellar/boost/1.58.0/lib/libboost_filesystem-mt.dylib ../Cellar/boost/1.58.0/lib/libboost_filesystem-mt.dylib: Mach-O dynamically linked shared library ppc
The file appears to exist, so I am a bit puzzled about why it is complaining about it being missing.
Do you have any idea how to fix this? If so, do you know a convenient way to continue the build process where it left off, without having to wait ~5+ hours for the toolchain to build all over again?
Any help would be greatly appreciated! :-)
Versions:
bluebox:/usr/local/lib alex$ gcc-7 --version gcc-7 (Tigerbrew gcc 7.3.0) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bluebox:~ alex$ brew install boost --c++11 ==> Downloading https://downloads.sourceforge.net/project/boost/boost/1.58.0/boo ######################################################################### 100.0%######################################################################### 100.0% ==> ./bootstrap.sh --prefix=/usr/local/Cellar/boost/1.58.0 --libdir=/usr/local/C ==> ./b2 headers ==> ./b2 --prefix=/usr/local/Cellar/boost/1.58.0 --libdir=/usr/local/Cellar/boos ==> Caveats
Building of Boost.Context and Boost.Coroutine is disabled as they are only supported on x86_64. ==> Summary /usr/local/Cellar/boost/1.58.0: 10704 files, 532M, built in 227.5 minutes
No idea yet, I'll see if I can reproduce things.
If so, do you know a convenient way to continue the build process where it left off, without having to wait ~5+ hours for the toolchain to build all over again?
Most importantly:
../Retro68/build-toolchain.bash --skip-thirdparty
... will skip the really time-consuming parts of the build (binutils and gcc).
Alternatively, you can also cd directly to Retro68-build/build-host and run make there - this will only build Rez and other native tools specific to Retro68 (after it's done, the Retro68 build won't be complete, but you'll know if the ResInfo issue has been fixed).
Hello! Thank you for your quick reply!
I have actually just tried to temporarily move the symlink altogether in order to simulate a "missing file" - and it actually showed me a different error message:
bluebox:/usr/local/lib alex$ bluebox:/usr/local/lib alex$ mv -v libboost_filesystem-mt.dylib libboost_filesystem-mt.dylib.broken
bluebox:/opt/retro68/build-host alex$ make [ 67%] Built target ELF [ 70%] Built target ResourceFiles make[2]: *** No rule to make target /usr/local/lib/libboost_filesystem-mt.dylib', needed by ResourceFiles/ResInfo'. Stop. make[1]: *** [ResourceFiles/CMakeFiles/ResInfo.dir/all] Error 2 make: *** [all] Error 2
This lets me conclude that there are actually symbols missing in the boost libraries I built using tigerbrew themselves. Strange. If I can provide you with any additional information, I would be glad to assist. It would be cool to have a semi-self-hosted Retro68 (compile on a native OS X system that can actually run Classic or even dual-boot with OS9).
Seems like this behavior might be a problem of older boost versions. (Tigerbrew uses 1.58) I'm also looking into it.
See: https://stackoverflow.com/a/30877725 AND https://github.com/boostorg/system/commit/829a1320a7bef3ade74d6691fdcfe72e0b6917e9
Ok, so that's strange. I just managed to build it again on my G5, using tigerbrew, and allegedly using the same versions of gcc and boost as you are using. And it worked. (And the powerpc linker crashed later, but that's a different problem).
It looks like it somehow does not manage to find/link to the boost "system" library (which is required by the "filesystem" library).
So... could you try...
bluebox:/opt/retro68/build-host alex$ make VERBOSE=1
so that we can see what the actual link command is?
The CMakeCache.txt file might also contain relevant information - could you attach that for me?
And while we are sending files, maybe I should compare your libboost_filesystem-mt.dylib and libboost_system-mt.dylib to mine.
Hello! Thanks a lot for your help.
Here you go:
bluebox:/opt/retro68/build-host alex$ make VERBOSE=1
/usr/local/Cellar/cmake/3.6.3/bin/cmake -H/Users/alex/git/Retro68 -B/opt/retro68/build-host --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/3.6.3/bin/cmake -E cmake_progress_start /opt/retro68/build-host/CMakeFiles /opt/retro68/build-host/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make -f libelf/CMakeFiles/ELF.dir/build.make libelf/CMakeFiles/ELF.dir/depend
cd /opt/retro68/build-host && /usr/local/Cellar/cmake/3.6.3/bin/cmake -E cmake_depends "Unix Makefiles" /Users/alex/git/Retro68 /Users/alex/git/Retro68/libelf /opt/retro68/build-host /opt/retro68/build-host/libelf /opt/retro68/build-host/libelf/CMakeFiles/ELF.dir/DependInfo.cmake --color=
make -f libelf/CMakeFiles/ELF.dir/build.make libelf/CMakeFiles/ELF.dir/build
make[2]: Nothing to be done for libelf/CMakeFiles/ELF.dir/build'. [ 67%] Built target ELF make -f ResourceFiles/CMakeFiles/ResourceFiles.dir/build.make ResourceFiles/CMakeFiles/ResourceFiles.dir/depend cd /opt/retro68/build-host && /usr/local/Cellar/cmake/3.6.3/bin/cmake -E cmake_depends "Unix Makefiles" /Users/alex/git/Retro68 /Users/alex/git/Retro68/ResourceFiles /opt/retro68/build-host /opt/retro68/build-host/ResourceFiles /opt/retro68/build-host/ResourceFiles/CMakeFiles/ResourceFiles.dir/DependInfo.cmake --color= make -f ResourceFiles/CMakeFiles/ResourceFiles.dir/build.make ResourceFiles/CMakeFiles/ResourceFiles.dir/build make[2]: Nothing to be done for ResourceFiles/CMakeFiles/ResourceFiles.dir/build'.
[ 70%] Built target ResourceFiles
make -f ResourceFiles/CMakeFiles/ResInfo.dir/build.make ResourceFiles/CMakeFiles/ResInfo.dir/depend
cd /opt/retro68/build-host && /usr/local/Cellar/cmake/3.6.3/bin/cmake -E cmake_depends "Unix Makefiles" /Users/alex/git/Retro68 /Users/alex/git/Retro68/ResourceFiles /opt/retro68/build-host /opt/retro68/build-host/ResourceFiles /opt/retro68/build-host/ResourceFiles/CMakeFiles/ResInfo.dir/DependInfo.cmake --color=
make -f ResourceFiles/CMakeFiles/ResInfo.dir/build.make ResourceFiles/CMakeFiles/ResInfo.dir/build
[ 70%] Linking CXX executable ResInfo
cd /opt/retro68/build-host/ResourceFiles && /usr/local/Cellar/cmake/3.6.3/bin/cmake -E cmake_link_script CMakeFiles/ResInfo.dir/link.txt --verbose=1
/usr/local/bin/g++-7 --std=c++0x -Wall -Werror=return-type -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/ResInfo.dir/ResInfo.cc.o -o ResInfo libResourceFiles.a /usr/local/lib/libboost_program_options-mt.dylib /usr/local/lib/libboost_filesystem-mt.dylib /usr/local/lib/libboost_system-mt.dylib /opt/retro68/toolchain/lib/libhfs.a
/usr/bin/ld: warning can't open dynamic library: @loader_path/libboost_system-mt.dylib referenced from: /usr/local/lib/libboost_filesystem-mt.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: Undefined symbols:
boost::system::system_category() referenced from libboost expected to be defined in @loader_path/libboost_system-mt.dylib
boost::system::generic_category() referenced from libboost expected to be defined in @loader_path/libboost_system-mt.dylib
collect2: error: ld returned 1 exit status
make[2]: *** [ResourceFiles/ResInfo] Error 1
make[1]: *** [ResourceFiles/CMakeFiles/ResInfo.dir/all] Error 2
make: *** [all] Error 2
You were right all along. We do need a new boost version. I had actually built boost 1.67 on my G5 some time in the past, but failed to uninstall the brew version, and then completely forgot about it. So my "works on my machine" was actually boost 1.67.
I tried building boost --HEAD via tigerbrew, but the cmake version I have installed fails to properly link to that. I had already built cmake 3.11 myself, but even that wasn't new enough.
So now I tried brew install cmake --HEAD, but that doesn't work.
Looks like tirgerbrew needs contributions of decent cmake and boost formulae...
Thanks for your effort! That's interesting... Would you like me to open an "Issue" over at TigerBrew's page? Or would you prefer to do it yourself?
I will attempt to modify these formulaes myself, but I have never worked with brew's internals before. And these packages won't be as trivial to update like a GNU nano package.
Have a nice day. Alexander
I'm sure Misty will appreciate it, regardless of who does it!
Brew formulae don't require a lot of wizardry, though; mostly just take the existing one, bump the version, and see what happens.