From c57dbaf292cb09b38507b4f3f7f6359da303628c Mon Sep 17 00:00:00 2001 From: psykose Date: Wed, 22 Mar 2023 20:19:36 +0000 Subject: [PATCH] community/webkit2gtk: fix dlopen of libwebkit --- community/webkit2gtk/APKBUILD | 4 +++- community/webkit2gtk/initial-exec.patch | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 community/webkit2gtk/initial-exec.patch diff --git a/community/webkit2gtk/APKBUILD b/community/webkit2gtk/APKBUILD index a75d442ab2f..659fd7f5d40 100644 --- a/community/webkit2gtk/APKBUILD +++ b/community/webkit2gtk/APKBUILD @@ -4,7 +4,7 @@ # Maintainer: psykose pkgname=webkit2gtk pkgver=2.40.0 -pkgrel=0 +pkgrel=1 pkgdesc="Portable web rendering engine WebKit for GTK+" url="https://webkitgtk.org/" arch="all" @@ -57,6 +57,7 @@ replaces="webkit" options="!check" # upstream doesn't package them in release tarballs: Tools/Scripts/run-gtk-tests: Command not found subpackages="$pkgname-dev $pkgname-lang $pkgname-dbg" source="https://webkitgtk.org/releases/webkitgtk-$pkgver.tar.xz + initial-exec.patch riscv-fix-1.patch riscv-fix-2.patch riscv-fix-3.patch @@ -376,6 +377,7 @@ dbg() { sha512sums=" 550dafb31d71edf984d6b7636366f839d31f6b244b87f83c6efe7af17efe3f2f63268d2c39a6a3c474afadf2b30df868efaefcf38197b30cc6b11c63de7d2ddc webkitgtk-2.40.0.tar.xz +26f3df81758068a83bf770e1f8b48546e9ec2428d23cbc4e1c5cc7851c91ad1dfeeac89aea73568a5f498cd6c053aaab7e1af67e59a471ad2d0375c1c64cbd8a initial-exec.patch 8ddd2cb2a10aa4c9296ae641e15ff8b58fd48c9fd9ccc5a4b2ebc40c4a90e3f2cffa3d9e030b0038a169d97f463b62d64707caa2c64eaea21cfce0f0a04d29d4 riscv-fix-1.patch a5a5d62aea820c087f7919b617bef5adefa6f34a8189fe1993250535ff59585bed4c6fd24d69caaeb814dcaa449194dd533886a41e70acceb3882f8399494404 riscv-fix-2.patch 5f9c44fd9b29587110208ad63e845eb178cc517a56e18bd0a4c17acc5dfa772c6b92bacad219b9e1910e030e019b125a7ec523f85af013bd53f05e4e30e595cb riscv-fix-3.patch diff --git a/community/webkit2gtk/initial-exec.patch b/community/webkit2gtk/initial-exec.patch new file mode 100644 index 00000000000..422df809abc --- /dev/null +++ b/community/webkit2gtk/initial-exec.patch @@ -0,0 +1,22 @@ +it is not portable to use initial-exec in shared objects that are meant to be +dlopen'd. +glibc reserves some space to allow this anyway- but other libcs like musl do +not. +using an initial-exec variables forces the entire libwebkit2gtk.so to gain a TLS +program header, which makes it fail to dlopen with musl's loader. + +see https://gitlab.freedesktop.org/mesa/mesa/-/commit/8570a2a280587a1e43ac11ad46ad62dfdd6c7b39 +-- +diff --git a/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp b/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp +index f8627d2c..6666f6d0 100644 +--- a/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp ++++ b/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp +@@ -108,7 +108,7 @@ RefPtr GraphicsContextGLANGLE::readCompositedResults() + + bool GraphicsContextGLANGLE::makeContextCurrent() + { +- static thread_local TLS_MODEL_INITIAL_EXEC GraphicsContextGLANGLE* s_currentContext { nullptr }; ++ static thread_local GraphicsContextGLANGLE* s_currentContext { nullptr }; + + if (s_currentContext == this) + return true;