ProtoCorgi

ProtoCorgi

View Stats:
[elf/linux] fixes required for beta build
c++ ABI issue: the game does not load with the current steam runtime libstdc++, the godot buildroot scripts are missing the "-static-libgcc -static-libstdc++" compilation/linking options (and removal of parasitic -lgcc_s linking options if any).

The detailed fix is at the end of this post in the conclusion of the audit.

ERROR: Can't open dynamic library: store_api_native/bin/x11/release/libDLLSteam.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/250/SteamLibrary/steamapps/common/ProtoCorgi/libDLLSteam.so) at: open_dynamic_library (drivers/unix/os_unix.cpp:418)

-------------

Follows an audit of your 3 distributed ELF binaries, using the GNU binutils "readelf -a -W" command and the required fix:

* libDLLSteam.so

You have in "NEEDED" entries: libstdc++.so.6 and libgcc_s.so.1 which should not be there: to remove them use the options at the start of this post.

Down the output of the readelf commmand, you have the "needed" GNU version names, the "Version needs section" (.gnu.version_r), your binaries will refuse to load on system without the most recent version names you have in your binaries:
There I see:
GCC_3.0, parasitic due to the missing -static-libgcc compile/link option.
GLIBCXX_* and CXXABI_*, which should not be there, parasitic due to the missing -static-libstdc++ compile/link option.
The highest version name constraint is GLIBC_2.14, which is ok because old enough (see the glibc time line: https://sourceware.org/glibc/wiki/Glibc%20Timeline )

* libsteam_api.so

"NEEDED" entries contains only glibc libs (or video game core libs), ok.

.gnu.version_r : most recent version names, GLIBC_2.14, ok old enough.

* protocorgi_linux_x64.x86_64

"NEEDED" entries contains only glibc libs (or video game core libs), ok.

(For you information: libGL should be dynamically loaded, but I did discovered that it is has the ELF STATIC_TLS flags which forces to statically load it on many distros :'(, the work around is only available on distro compiled with a recent gcc and the options '-ftls_model=global-dynamic -fpic")

.gnu.version_r : the most recent version name is GLIBC_2.28, which is ok because old enough (~2018 are the first vulkan AAA games on elf/linux).

----------------

Conclusion: only libDLLSteam.so seems not to be built properly, missing the "-static-libgcc -static-libstdc++" compile and link options (add a "-fpic -ftls_model=global-dynamic if your gcc is recent enough for good figure, and to try to avoid the ELF STATIC_TLS flag) and removing any parasitic -lgcc_s linking options.
Originally posted by Hearto-ハート심장心:
Hello,
We have updated the linux public testing branch, feel free to test it and confirm the state of the issue.

Here is more context about the issue if somebody is interested, the Custom Godot Engine and GDNative libraries was exported using one of the latest Ubuntu distributions, this lead to compatibility issues with older linux versions. To fix this we used the official godot build tools, the same they use to compile the official binaries. The OP tested this build, but there was still issues related to the our GDNative library libDLLSteam.so.
After checking the compilation of the GDNative so, we found that our SConstruct scons script had ignored the environment compilation flags, so it was compiled without the godot official build tools. After the fix this is the output of the readelf command:
readelf -a -W libDLLSteam.so
Version needs section '.gnu.version_r' contains 3 entries: Addr: 0x000000000012a788 Offset: 0x12a788 Link: 4 (.dynstr) 000000: Version: 1 File: ld-linux-x86-64.so.2 Cnt: 1 0x0010: Name: GLIBC_2.3 Flags: none Version: 8 0x0020: Version: 1 File: libm.so.6 Cnt: 1 0x0030: Name: GLIBC_2.2.5 Flags: none Version: 4 0x0040: Version: 1 File: libc.so.6 Cnt: 6 0x0050: Name: GLIBC_2.17 Flags: none Version: 9 0x0060: Name: GLIBC_2.14 Flags: none Version: 7 0x0070: Name: GLIBC_2.3.4 Flags: none Version: 6 0x0080: Name: GLIBC_2.3.2 Flags: none Version: 5 0x0090: Name: GLIBC_2.25 Flags: none Version: 3 0x00a0: Name: GLIBC_2.2.5 Flags: none Version: 2

Still this change for some reason added the additional requirement of the library
libsdkencryptedappticket, which was found with the "ldd libDLLSteam.so" command:
linux-vdso.so.1 (0x00007fff8010b000) libsteam_api.so => /mnt/c/bin/x11/release/./libsteam_api.so (0x00007f9e5fc00000) libsdkencryptedappticket.so => not found libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9e5f9bc000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9e5f794000) /lib64/ld-linux-x86-64.so.2 (0x00007f9e60289000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9e5ff16000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9e5ff0f000)
We added the missing libsdkencryptedappticket.so along with the dll, fixing all the issues.
< >
Showing 1-2 of 2 comments
The author of this thread has indicated that this post answers the original topic.
Hello,
We have updated the linux public testing branch, feel free to test it and confirm the state of the issue.

Here is more context about the issue if somebody is interested, the Custom Godot Engine and GDNative libraries was exported using one of the latest Ubuntu distributions, this lead to compatibility issues with older linux versions. To fix this we used the official godot build tools, the same they use to compile the official binaries. The OP tested this build, but there was still issues related to the our GDNative library libDLLSteam.so.
After checking the compilation of the GDNative so, we found that our SConstruct scons script had ignored the environment compilation flags, so it was compiled without the godot official build tools. After the fix this is the output of the readelf command:
readelf -a -W libDLLSteam.so
Version needs section '.gnu.version_r' contains 3 entries: Addr: 0x000000000012a788 Offset: 0x12a788 Link: 4 (.dynstr) 000000: Version: 1 File: ld-linux-x86-64.so.2 Cnt: 1 0x0010: Name: GLIBC_2.3 Flags: none Version: 8 0x0020: Version: 1 File: libm.so.6 Cnt: 1 0x0030: Name: GLIBC_2.2.5 Flags: none Version: 4 0x0040: Version: 1 File: libc.so.6 Cnt: 6 0x0050: Name: GLIBC_2.17 Flags: none Version: 9 0x0060: Name: GLIBC_2.14 Flags: none Version: 7 0x0070: Name: GLIBC_2.3.4 Flags: none Version: 6 0x0080: Name: GLIBC_2.3.2 Flags: none Version: 5 0x0090: Name: GLIBC_2.25 Flags: none Version: 3 0x00a0: Name: GLIBC_2.2.5 Flags: none Version: 2

Still this change for some reason added the additional requirement of the library
libsdkencryptedappticket, which was found with the "ldd libDLLSteam.so" command:
linux-vdso.so.1 (0x00007fff8010b000) libsteam_api.so => /mnt/c/bin/x11/release/./libsteam_api.so (0x00007f9e5fc00000) libsdkencryptedappticket.so => not found libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9e5f9bc000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9e5f794000) /lib64/ld-linux-x86-64.so.2 (0x00007f9e60289000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9e5ff16000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9e5ff0f000)
We added the missing libsdkencryptedappticket.so along with the dll, fixing all the issues.
Fixed! The game runs fine now!

Please, do not hesitate to spread the previous knowledge to people who would like to provide a native build for elf/linux.

----------------

The teachings are the following:
- elf/linux is a technical environment which is hostile to "binary-only" distribution (aka nearly all games). No evil intended, it is open source DNA. That will make it trickier to generate and support binaries than for most other OSes.

- glibc/c++ gcc devs are not your friends. They are only thinking about open source. They could not care less about binary only games (their behavior with their manic abuse of version names and buggy/ultra complex/unstable ABI like those of libgcc and libstdc++ is proof). Sometimes I think they are rolling for msft/apple/etc.

- I did spare you the next abominations which are coming:
* ELF STATIC_TLS (thread local storage) will forbid games to cleanly dynamically load some system dependencies (often the legacy libGL), if distros and games are carefull to use the "-ftls-model=global-dynamic -fpic" (*right now*) gcc options everywhere, it should not be too painful.
* a _genius_ did add, very recently, a brand new ELF relocation type, namely game binaries using this ELF relocation type won't be able to load with "older" ELF loaders... for the moment, games are not generated with this new ELF relocation type... but it will happen, and "old" (lol) ELF loaders will be unable to load such binaries (similar to symbol version names).

- c++ is an extremely expensive and toxic language. Keep it contained at the application level for non critical binary-only programs (games are fine then). I wish godot was plain and simple C (without the latest ISO tantrums), with preprocessor name mangling for vast namespace management.

The only way out of this, the clean way, would be a new modern file format of excruciatingly simplicity.
< >
Showing 1-2 of 2 comments
Per page: 1530 50