summaryrefslogtreecommitdiff
path: root/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch')
-rw-r--r--net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch b/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch
new file mode 100644
index 000000000000..6836e6935049
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch
@@ -0,0 +1,41 @@
+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-3.6.0-full.orig/Telegram/CMakeLists.txt
++++ tdesktop-3.6.0-full/Telegram/CMakeLists.txt
+@@ -1376,6 +1376,14 @@
+ desktop-app::external_kwayland
+ )
+ endif()
++
++ if (NOT DESKTOP_APP_DISABLE_JEMALLOC)
++ target_link_libraries(Telegram
++ INTERFACE
++ $<TARGET_OBJECTS:desktop-app::linux_jemalloc_helper>
++ $<LINK_ONLY:desktop-app::external_jemalloc>
++ )
++ endif()
+ endif()
+
+ if (build_macstore)
+--- tdesktop-3.6.0-full.orig/cmake/options_linux.cmake
++++ tdesktop-3.6.0-full/cmake/options_linux.cmake
+@@ -62,14 +62,6 @@
+ target_link_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g -flto -fuse-linker-plugin>)
+ endif()
+
+-if (NOT DESKTOP_APP_DISABLE_JEMALLOC)
+- target_link_libraries(common_options
+- INTERFACE
+- $<TARGET_OBJECTS:desktop-app::linux_jemalloc_helper>
+- $<LINK_ONLY:desktop-app::external_jemalloc>
+- )
+-endif()
+-
+ target_link_libraries(common_options
+ INTERFACE
+ ${CMAKE_DL_LIBS}