RetroDebugger icon indicating copy to clipboard operation
RetroDebugger copied to clipboard

Linux build failure; LTO v9.2 vs expected 14.0

Open VanessaE opened this issue 8 months ago • 1 comments

Describe the bug

Building MTEngineSDL went fine, no errors at all, but when I went to build Retrodebugger against it, the build got nearly all the way through, and then failed right at the end:

[ 99%] Building C object CMakeFiles/retrodebugger.dir/platform/Linux/src.Linux/archdep.c.o
[ 99%] Building C object CMakeFiles/retrodebugger.dir/platform/Linux/src.Linux/mididrv.c.o
/home/vanessa/Commodore-related/Software/PC-tools/RetroDebugger/src/Tools/C64SettingsStorage.cpp:116:11: warning: ‘c64SettingsC64SidImportMode’ initialized and declared ‘extern’
  116 | extern u8 c64SettingsC64SidImportMode = SID_IMPORT_MODE_PSID64;
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[100%] Linking CXX executable retrodebugger
lto1: fatal error: bytecode stream in file ‘/home/vanessa/Commodore-related/Software/PC-tools/RetroDebugger/../MTEngineSDL/platform/Linux/libs/uSockets.a’ generated with LTO version 9.2 instead of the expected 14.0
compilation terminated.
lto-wrapper: fatal error: /usr/bin/c++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/retrodebugger.dir/build.make:3326: retrodebugger] Error 1
make[1]: *** [CMakeFiles/Makefile2:230: CMakeFiles/retrodebugger.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

To Reproduce

The following is basically the build instructions for MTEngineSDL and Retrodebugger, combined into one block of instructions (for my "install my system" reference script, but that's not really relevant here):

cd /home/vanessa/Commodore-related/Software/PC-tools/
rm -rf RetroDebugger MTEngineSDL

git clone https://github.com/slajerek/MTEngineSDL.git
git clone https://github.com/slajerek/RetroDebugger.git

cd MTEngineSDL
mkdir build
cd build
cmake ./../
make -j12

cd ../../RetroDebugger/
mkdir build
cd build
cmake ./../
make -j12

Expected behavior

It should have built. 😛

Desktop (please complete the following information):

OS: Linux -- Debian testing, newly-downloaded and installed a week or so ago (this is what will become "Trixie" soon-ish). Last updated yesterday.

Other info

For the sake of completeness, here is the full build log of both projects, starting with deleting and re-cloning them both, through to the end where the Retrodebugger build errors-out:

build-retrodebugger.txt

VanessaE avatar Apr 11 '25 11:04 VanessaE

FYI: I see the same problem when building on ArchLinux - It has been like that for at least 3-4 weeks - I've just not found the time to report it

UffeJakobsen avatar Apr 11 '25 11:04 UffeJakobsen

I've just checked this repo out today for first time on Arch, and the only compilation error I got was "bool" type, which I fixed with:

❯ git diff
diff --git a/src/Emulators/vice/monitor/montypes.h b/src/Emulators/vice/monitor/montypes.h
index 8c9d99fc..99563a7d 100644
--- a/src/Emulators/vice/monitor/montypes.h
+++ b/src/Emulators/vice/monitor/montypes.h
@@ -40,10 +40,12 @@
 /* Types */
 
 #ifndef __cplusplus
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
 #ifndef bool
 typedef int bool;
 #endif
 #endif
+#endif

markjfisher avatar May 25 '25 17:05 markjfisher

Thanks for reporting. That is because you did not compile uSockets library first. This is static lib, I fixed this with build script some time ago, but I forgot to update the README, thanks. Hope this fixes it for you: https://github.com/slajerek/MTEngineSDL/commit/07de3cf5dccbfc91a184d102f2514c92e5f0ea9e

btw. thanks for the patch @markjfisher I've added it too. Please let me know if it works for you now.

Linux

You need SDL2 and GLEW installed: sudo apt install libsdl2-dev sudo apt install libglew-dev

Put MTEngineSDL and RetroDebugger folders into the same folder and then compile.

cd RetroDebbugger ./build-linux.sh Remember to have MTEngineSDL library in ./../MTEngineSDL folder (btw. there's another typo in README here :D)

slajerek avatar May 25 '25 22:05 slajerek

Sorry I didn't get a chance to try this out! I have moved machines a lot recently and haven't got the code checked out anymore.

markjfisher avatar Oct 15 '25 16:10 markjfisher

No problem, if you encounter this again then just please reopen this issue.

slajerek avatar Oct 15 '25 18:10 slajerek