From fbe4e3f0ecadb801945f477cc44d6dff80acf092 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 17 May 2021 13:12:22 +0400 Subject: [PATCH] Fix build with mallocng. --- Telegram/SourceFiles/_other/packer.cpp | 2 +- .../platform/linux/specific_linux.cpp | 22 +++++++++++-------- Telegram/ThirdParty/hime | 2 +- cmake | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Telegram/SourceFiles/_other/packer.cpp b/Telegram/SourceFiles/_other/packer.cpp index 630c0b940..2fa976b3d 100644 --- a/Telegram/SourceFiles/_other/packer.cpp +++ b/Telegram/SourceFiles/_other/packer.cpp @@ -538,7 +538,7 @@ QString countAlphaVersionSignature(quint64 version) { // duplicated in autoupdat uint32 siglen = 0; - RSA *prKey = [] { + RSA *prKey = [&] { const auto bio = makeBIO( const_cast(cAlphaPrivateKey.constData()), -1); diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 6bc833ac0..da5a8f483 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -746,15 +746,19 @@ int psFixPrevious() { namespace Platform { void start() { - // avoid stripping custom allocator - malloc(0); - calloc(0, 0); - realloc(nullptr, 0); - free(nullptr); - aligned_alloc(0, 0); - malloc_usable_size(nullptr); - memalign(0, 0); - posix_memalign(nullptr, 0, 0); + // Avoid stripping custom allocator methods. + const auto address = [](auto method) { + return reinterpret_cast(method); + }; + const auto value = address(malloc) + + address(calloc) + + address(realloc) + + address(free) + + address(aligned_alloc) + + address(malloc_usable_size) + + address(memalign) + + address(posix_memalign); + DEBUG_LOG(("Malloc addresses %1.").arg(value ? "non-null" : "null")); LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName())); diff --git a/Telegram/ThirdParty/hime b/Telegram/ThirdParty/hime index 62424e7ba..752564559 160000 --- a/Telegram/ThirdParty/hime +++ b/Telegram/ThirdParty/hime @@ -1 +1 @@ -Subproject commit 62424e7babdc4aa4bce9514064e47c6e4a2cf33e +Subproject commit 7525645598649afeab5bfe7fda612c2ad744e7a3 diff --git a/cmake b/cmake index 294a18baf..de6551913 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 294a18baf8896609aeb78b0d9b92a8011b0fa2e5 +Subproject commit de65519132126db2c2166cdf5af5f12e61652419