X11: Link libgcc statically with use_static_cpp option

We were already linking libstdc++ statically for official binaries,
protecting us against most portability issues. But apparently since
we started using GCC 7 for official builds, we also need to link
libgcc statically for at least 32-bit builds to be portable.

Fixes #16409.

(cherry picked from commit b526088ae2)
This commit is contained in:
Rémi Verschelde 2018-02-16 18:24:46 +01:00
parent 4974e9bb96
commit bad7a8a657

View File

@ -52,7 +52,7 @@ def get_opts():
return [
('use_llvm', 'Use llvm compiler', 'no'),
('use_static_cpp', 'link stdc++ statically', 'no'),
('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', 'no'),
('use_sanitizer', 'Use llvm compiler sanitize address', 'no'),
('use_leak_sanitizer', 'Use llvm compiler sanitize memory leaks', 'no'),
('use_lto', 'Use link time optimization', 'no'),
@ -254,8 +254,9 @@ def configure(env):
env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.gen.h', src_suffix='.glsl')})
#env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.gen.h',src_suffix = '.hlsl') } )
# Link those statically for portability
if (env["use_static_cpp"] == "yes"):
env.Append(LINKFLAGS=['-static-libstdc++'])
env.Append(LINKFLAGS=['-static-libgcc', '-static-libstdc++'])
list_of_x86 = ['x86_64', 'x86', 'i386', 'i586']
if any(platform.machine() in s for s in list_of_x86):