From da71938d18a77ae4d59a30ea8a8e3774aef3dfb4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 23 Nov 2017 09:29:56 +0400 Subject: [PATCH] Link libstdc++ statically in Updater. This will allow running it on Ubuntu 12.04 when it was built on 14.04. --- Telegram/build/build.sh | 20 ++++++++++++++++++++ Telegram/gyp/utils.gyp | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/Telegram/build/build.sh b/Telegram/build/build.sh index 38122adb9..a235c5965 100755 --- a/Telegram/build/build.sh +++ b/Telegram/build/build.sh @@ -155,6 +155,26 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then Error "Updater not found!" fi + BadCount=`objdump -T $ReleasePath/Updater | grep GLIBC_2\.1[6-9] | wc -l` + if [ "$BadCount" != "0" ]; then + Error "Bad GLIBC usages found: $BadCount" + fi + + BadCount=`objdump -T $ReleasePath/Updater | grep GLIBC_2\.2[0-9] | wc -l` + if [ "$BadCount" != "0" ]; then + Error "Bad GLIBC usages found: $BadCount" + fi + + BadCount=`objdump -T $ReleasePath/Updater | grep GCC_4\.[3-9] | wc -l` + if [ "$BadCount" != "0" ]; then + Error "Bad GCC usages found: $BadCount" + fi + + BadCount=`objdump -T $ReleasePath/Updater | grep GCC_[5-9]\. | wc -l` + if [ "$BadCount" != "0" ]; then + Error "Bad GCC usages found: $BadCount" + fi + echo "Dumping debug symbols.." "$HomePath/../../Libraries/breakpad/out/Default/dump_syms" "$ReleasePath/$BinaryName" > "$ReleasePath/$BinaryName.sym" echo "Done!" diff --git a/Telegram/gyp/utils.gyp b/Telegram/gyp/utils.gyp index 1bd6b6381..58d75ffb5 100644 --- a/Telegram/gyp/utils.gyp +++ b/Telegram/gyp/utils.gyp @@ -51,6 +51,10 @@ 'sources!': [ '<(src_loc)/_other/updater_linux.cpp', ], + }, { + 'ldflags': [ + '-static-libstdc++', + ], }], [ '"<(build_mac)" != "1"', { 'sources!': [