PleasingFungus / Silicon-Zeroes

Issue repository for Silicon Zeroes. (Contains no actual code.)
12 stars 0 forks source link

Linux demo fails relocation against libstdc++ from Steam Runtime #115

Open amonakov opened 7 years ago

amonakov commented 7 years ago

Trying to run the Linux Demo from Steam, I get

./rawexec: relocation error: ./rawexec: symbol _ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

This indicates that the demo is linked against a newer version of libstdc++ than what is shipped in the Steam Runtime. I guess for some users this is not a show-stopper, because they have to remove the older libstdc++ from the runtime anyhow (or use modern native libraries without the runtime in the first place), but would be nice to get resolved if possible.

franciscod commented 7 years ago

Are you launching the game

amonakov commented 7 years ago

From the Steam UI.

When shipping games for Steam-on-Linux, it is important to make sure that the game does not have higher API/ABI requirements than what the Steam Runtime libraries would provide. A fairly natural way to achieve that is building the game in the steam runtime chroot in the first place.

You can use nm -CD on rawexec game/demo binary and libstdc++.so in the steam runtime to verify that the former has various undefined references to symbols in std::__cxx11 namespace while the latter provides no definitions for those.

franciscod commented 7 years ago

Thanks for the pointers! That nm looks a bit more helplful than ldd.

Unfortunately the steam runtime chroot is based on an old Ubuntu LTS (12.04) that is unsupported and doesn't provide some of the game dependencies, so building under it isn't as direct as we'd wish. But it's definitely doable!

amonakov commented 7 years ago

I think there's also the option of building with g++ -static-libstdc++ to avoid dynamic dependency on build-time libstdc++, assuming the game never passes STL objects such as std::string to external APIs.

amonakov commented 7 years ago

Unfortunately the steam runtime chroot is based on an old Ubuntu LTS (12.04) that is unsupported and doesn't provide some of the game dependencies

Consider what would happen if a user would try to launch the game (purchased/downloaded via Steam) on SteamOS. If it fails relocation against steam runtime libstdc++, it would likewise fail to load on SteamOS.