diff options
Diffstat (limited to 'net-im/telegram-desktop/files')
-rw-r--r-- | net-im/telegram-desktop/files/tdesktop-2.8.10-jemalloc-only-telegram.patch | 31 | ||||
-rw-r--r-- | net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch | 100 |
2 files changed, 31 insertions, 100 deletions
diff --git a/net-im/telegram-desktop/files/tdesktop-2.8.10-jemalloc-only-telegram.patch b/net-im/telegram-desktop/files/tdesktop-2.8.10-jemalloc-only-telegram.patch new file mode 100644 index 000000000000..8604acc6a74d --- /dev/null +++ b/net-im/telegram-desktop/files/tdesktop-2.8.10-jemalloc-only-telegram.patch @@ -0,0 +1,31 @@ +Only link jemalloc for the Telegram binary + +Some combination of factors is making the different codegen tools hang when +jemalloc is linked for those, and they're ran under portage's sandbox. Since +this is only used during build-time, and jemalloc is merely necessary to +improve runtime memory use, it's unnecessary to use it for anything else. + +--- tdesktop-2.8.10-full.orig/Telegram/CMakeLists.txt ++++ tdesktop-2.8.10-full/Telegram/CMakeLists.txt +@@ -87,6 +87,7 @@ + PRIVATE + desktop-app::external_glibmm + desktop-app::external_glib ++ desktop-app::external_jemalloc + ) + + if (NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION) +--- tdesktop-2.8.10-full.orig/cmake/options_linux.cmake ++++ tdesktop-2.8.10-full/cmake/options_linux.cmake +@@ -58,11 +58,6 @@ + endif() + endif() + +-target_link_libraries(common_options +-INTERFACE +- desktop-app::external_jemalloc +-) +- + if (DESKTOP_APP_USE_PACKAGED) + find_library(ATOMIC_LIBRARY atomic) + else() diff --git a/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch b/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch deleted file mode 100644 index dff2455d4e3d..000000000000 --- a/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch +++ /dev/null @@ -1,100 +0,0 @@ -Allow controlling the use of jemalloc - -Jemalloc is often controlled through USE=jemalloc in Gentoo. Removing or -replacing it is trivial, and I'm not aware of any particular advantages that -come with using this allocator, especially for an IM client. Benchmarks -regarding this allocator provide a huge variety of results depending on the -workload and system, so it's hard to establish when this allocator provides any -tangible advantage. - -Considering things like Hardened Gentoo, the user might prefer to use a more -exploit-resistant allocator, like GrapheneOS/hardened_malloc, and I've heard -Musl is hardening their allocator as well. - -I trust the user can better judge if they need this in their particular setup. - -If a telegram dev is reading this, feel free to drop me a message (metadata.xml -contains the maintainer's address), if you believe it should be forced due to -usability concerns, or if you can provide me with some context I might be -missing. Jemalloc is currently enabled by default. - ---- tdesktop-2.8.9-full.orig/Telegram/SourceFiles/platform/linux/specific_linux.cpp -+++ tdesktop-2.8.9-full/Telegram/SourceFiles/platform/linux/specific_linux.cpp -@@ -48,7 +48,10 @@ - #include <gio/gio.h> - #include <glibmm.h> - #include <giomm.h> -+ -+#ifndef DESKTOP_APP_DISABLE_JEMALLOC - #include <jemalloc/jemalloc.h> -+#endif // !DESKTOP_APP_DISABLE_JEMALLOC - - #include <sys/stat.h> - #include <sys/types.h> -@@ -727,8 +730,10 @@ - namespace Platform { - - void start() { -+#ifndef DESKTOP_APP_DISABLE_JEMALLOC - auto backgroundThread = true; - mallctl("background_thread", nullptr, nullptr, &backgroundThread, sizeof(bool)); -+#endif // !DESKTOP_APP_DISABLE_JEMALLOC - - LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName())); - ---- tdesktop-2.8.9-full.orig/cmake/external/CMakeLists.txt -+++ tdesktop-2.8.9-full/cmake/external/CMakeLists.txt -@@ -37,7 +37,7 @@ - add_checked_subdirectory(hunspell) - endif() - add_checked_subdirectory(iconv) --if (LINUX) -+if (LINUX AND NOT DESKTOP_APP_DISABLE_JEMALLOC) - add_checked_subdirectory(jemalloc) - endif() - add_checked_subdirectory(jpeg) ---- tdesktop-2.8.9-full.orig/cmake/options.cmake -+++ tdesktop-2.8.9-full/cmake/options.cmake -@@ -56,6 +56,13 @@ - ) - endif() - -+if (DESKTOP_APP_DISABLE_JEMALLOC) -+ target_compile_definitions(common_options -+ INTERFACE -+ DESKTOP_APP_DISABLE_JEMALLOC -+ ) -+endif() -+ - if (DESKTOP_APP_USE_PACKAGED) - target_compile_definitions(common_options - INTERFACE ---- tdesktop-2.8.9-full.orig/cmake/options_linux.cmake -+++ tdesktop-2.8.9-full/cmake/options_linux.cmake -@@ -58,10 +58,12 @@ - endif() - endif() - --target_link_libraries(common_options --INTERFACE -- desktop-app::external_jemalloc --) -+if (NOT DESKTOP_APP_DISABLE_JEMALLOC) -+ target_link_libraries(common_options -+ INTERFACE -+ desktop-app::external_jemalloc -+ ) -+endif() - - if (DESKTOP_APP_USE_PACKAGED) - find_library(ATOMIC_LIBRARY atomic) ---- tdesktop-2.8.9-full.orig/cmake/variables.cmake -+++ tdesktop-2.8.9-full/cmake/variables.cmake -@@ -38,6 +38,7 @@ - option(DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF) - option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." ${osx_special_target}) - option(DESKTOP_APP_DISABLE_WEBKIT "Disable WebkitGTK library (Linux only)." OFF) -+option(DESKTOP_APP_DISABLE_JEMALLOC "Disable use of the jemalloc allocator (Linux only)." OFF) - option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target}) - option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate}) - option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled Hunspell only. (For debugging purposes)" OFF) |