third-party games are not forced to link gcc runtime libraries statically
Some game devs using the steam runtime build containers are getting libgcc/c++ ABI issues because the build scripts for game builds are missing the following critical options:
-static-libgcc -static-libstdc++
Thoses will zap libgcc/c++ ABI issues for good. Additionnaly, while we are at it, it may be a good idead to add -ftls-model=global-dynamic that to spare for the system interface shared libs those precious ELF static TLS slots.
When developing games for Steam, it's important to ensure everything runs smoothly across different setups. To avoid issues with compatibility, especially with the libraries that your game depends on, you can add a couple of flags to your build scripts:
-static-libgcc and -static-libstdc++: These flags make sure that the C and C++ standard libraries are included directly in your game’s executable. This way, you won’t run into problems if the library versions differ between your development environment and where your game is played. It’s like packing your own versions of the tools you need, so there are no surprises later!
-ftls-model=global-dynamic: This one helps manage how thread-specific data is stored. By using this option, you can save valuable resources and prevent running into issues if you have many threads. It optimizes how your game uses memory for thread-local storage, which can help everything run more smoothly.