GodotSteam: Linux libgodotstream.so fails to load complaining GLIBCXX_3.4.29 on a custom Linux build
Describe the bug
This is a bug report based on discussion in Steam https://steamcommunity.com/app/2337770/discussions/0/3882724699531919566/
My game, Tsetseg’s Adventure, is built with Godot 3.5.3 + GodotSteam. A player runs the game on his custom Linux build. The game fails to start, with an error message reported below.
ERROR: Can't open dynamic library: addons/godotsteam/x11/libgodotsteam.so. Error: /mnt/128/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /mnt/64fast/SteamLibrary/steamapps/common/Tsetseg's Adventure Demo/libgodotsteam.so)
The player pointed out that the libgodotsteam.so (3.5.1) plug-in should be compiled with compilation flag, “-static-libgcc -static-libstdc++”. It does not trigger error on my (I am the maker of game) test Linux distro because my /usr/lib/libstdc++.so has GLIBCXX_3.4.29 (verified via “readelf -a” command).
In Steam, libgodotstream.so relies on Steam runtime, a Ubuntu build, which covers at most GLIBCXX_3.4.21. Thus, when player’s custom Linux distro intentionally don’t provide fallback to GLIBCXX_3.4.29, the plug-in fails to load.
To Reproduce
It’s hard to really “reproduce” because it needs special configuration of system’s libstdc++.so. An idea is to verify it by running command below. If it prints lines like below, it should be able to trigger the bug.
$> readelf -a ~/projects/gaming/godot/tsetseg-haunted-house/publish/export/thha-0.2.0-linux-x11/libgodotsteam.so|grep GLIBCXX_3.4.29
000000454b58 001400000007 R_X86_64_JUMP_SLO 0000000000000000 _ZSt28__throw_bad[...]@GLIBCXX_3.4.29 + 0
20: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]@GLIBCXX_3.4.29 (7)
014: 7 (GLIBCXX_3.4.29) 4 (GLIBC_2.2.5) 1 (*global*) 8 (GLIBC_2.14)
0x0080: Name: GLIBCXX_3.4.29 Flags: none Version: 7
Expected behavior There should be no UND line below: 20: 0000000000000000 0 FUNC GLOBAL DEFAULT UND […]@GLIBCXX_3.4.29 (7)
Screenshots N/A
Desktop (please complete the following information):
- OS: Player really reproduce the bug with his custom Linux distro. But the step above can be reproduced at Manjaro Linux unsstable branch
- Version: N/A. It’s a rolling build without versioning. The latest updated was by Oct 27, 2023.
Version of Godot: Godot 3.5.3
Version of GodotSteam: GodotSteam 3.5.1
Additional context @Gramps has joined the discussion in Steam forum with me and bug reporter.
About this issue
- Original URL
- State: open
- Created 8 months ago
- Comments: 19 (10 by maintainers)
Typically these things work fine with most systems, you’re the only one who reported issues. Which is either good or bad. I read most of his posts about this. Typically buildroot solves these issues but perhaps not in this case. I wonder about his setup since he has issues; this being a problem with Linux, the wide variety of systems.
I will try some other compiling solutions to see what I can figure out and use the
readelf
to check them out. I hope to have another test soon.Hmm, that’s pretty weird. Yeah, I was going to run the flags MrOmega shared like we do for the PIC stuff. However, I was offline again and didn’t remember what they were! I just copied them down to try today and provide a new test when I’m back online!
Cool, I will check this out soon on my next WiFi adventure.
Also, here is a test file to try out to see if this fixes the issue: libgodotsteam-test.zip
This is made with the buildroot stuff that might not have been included for the version that is live. Let me know if this works.
Oh I forgot one thing. Besides Godot 3 version, I will test GDExtension verson for Godot 4 from December. Background: I’m porting my game to Godot 4. It is for Nintendo Switch porting but I plan to update Steam version to same codebase. So next version of my game on Steam will be based on Godot 4 as well.
Ugh, my internet is still dead but I will have something to test on Friday!
Hey there! Yeah, I think I mentioned somewhere else this is probably caused by a failure to include the buildroot tools during Linux compiling. We don’t have Github Actions doing it automatically, i don’t believe. Or if we do, it’s not working correctly. A relatively easy fix either way. When I get home from GodotCon on Wednesday, I will compile one with buildroot to see if this gets fixed and then make appropriate changes.
Thanks for making an official issue though! Keeps it fresh in my brain.