by alllexx88 » Mon May 20, 2024 5:56 pm
@graysky It's definitely has to do with 16k page size. And the solution is actually pretty simple: just add 'jemalloc' dependency to the PKGBUILD. Current telegram-desktop binary is built without external jemalloc, so the telegram-desktop cmake builds a static one for itself, without the support for 16k pages. While the extra/jemalloc package is built with 16k support, so all it takes is just linking against this jemalloc. I used Arch sources from make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://gitlab.archlinux.org/archlinux/packaging/packages/telegram-desktop', '', ' class="postlink"') with these minor adjustments:
[code]diff --git a/PKGBUILD b/PKGBUILD
index bfed5d5..e5ddb5a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,12 +2,12 @@
# Contributor: hexchain <i@hexchain.org>
pkgname=telegram-desktop
pkgver=5.0.1
-pkgrel=1
+pkgrel=2
pkgdesc='Official Telegram Desktop client'
-arch=('x86_64')
+arch=('aarch64' 'x86_64')
url="https://desktop.telegram.org/"
license=('GPL3')
-depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal'
+depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'jemalloc' 'lz4' 'minizip' 'openal'
'qt6-imageformats' 'qt6-svg' 'qt6-wayland' 'xxhash'
'rnnoise' 'pipewire' 'libxtst' 'libxrandr' 'libxcomposite' 'libxdamage' 'abseil-cpp' 'libdispatch'
'openssl' 'protobuf' 'glib2' 'libsigc++-3.0' 'kcoreaddons')[/code]
And the resulting binary indeed links against libjemalloc:
[code]$ ldd /usr/bin/telegram-desktop|grep jemalloc
libjemalloc.so.2 => /usr/lib/libjemalloc.so.2 (0x00007fff66200000)[/code]
And it works just fine with linux-rpi-16k.
@graysky do you happen to know how to suggest these changes to archlinuxarm codebase? Right now I don't see telegram-desktop on make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://github.com/archlinuxarm/PKGBUILDs', '', ' class="postlink"')
Thanks!