Page MenuHome

Use static libstdc++ when making a static build

Authored by Luca Rood (LucaRood) on Feb 22 2019, 6:44 PM.



This patch enables static linking of libstdc++ by default when building with WITH_STATIC_LIBS. This is already the current behaviour when using the buildbot script, but not for normal builds. This change makes Blender more portable (in particular to older systems), for anyone making static builds.

Diff Detail

rB Blender

Event Timeline

Not sure how much more portable build becomes (it is still limited to quite latest symbols from libc), but nothing against this change.

The increase in portability is significant. With static libstdc++, builds will run in RHEL/Centos 7, for example.

When building on GCC 4.9, linking against glibc 2.19, the build does not link against any newer symbols from 2.19, allowing it to run even on legacy enterprise systems running glibc 2.17. The only issue on the systems mentioned before, is libstdc++, which is 6.0.20 when building with gcc 4.9, while those systems are still using 6.0.19.

Of course one can always set the linker flag manually, but this patch just makes it easier for anyone targetting those (very popular) systems.

So if there are no objections, can I commit it?

Shouldn't by that logic the buildbots work on centos7? feebdack from users seems to indicate that is not the case

scratch that, buildbot is running gcc 6.x which ruins the party.

Yep, the problem is the gcc version. Centos is not happy with glibc 2.24. Therefore I'm building with gcc 4.9, but even still, the libstdc++ version is slightly too new for Centos.

This revision is now accepted and ready to land.Feb 25 2019, 5:46 AM
This revision was automatically updated to reflect the committed changes.