From 689dfcd9ec5ad8aceabd96aaadf6eb57a31e62e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 22 Feb 2018 19:06:11 +0100 Subject: [PATCH] server: Add support for statically linking libgcc and libstdc++ (cherry picked from commit be7bfdfac30b3772fde6058d470b81b480f03be7) --- platform/server/detect.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/server/detect.py b/platform/server/detect.py index c7a96de2340..f550cca22a1 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -22,6 +22,7 @@ def get_opts(): from SCons.Variables import BoolVariable return [ BoolVariable('use_llvm', 'Use the LLVM compiler', False), + BoolVariable('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', False), ] @@ -135,3 +136,7 @@ def configure(env): env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED']) env.Append(LIBS=['pthread']) env.Append(LIBS=['dl']) + + # Link those statically for portability + if env['use_static_cpp']: + env.Append(LINKFLAGS=['-static-libgcc', '-static-libstdc++'])