Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions srcpkgs/firefox/patches/gmp-sandbox-musl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff -ruN a/dom/media/gmp/GMPLoader.cpp b/dom/media/gmp/GMPLoader.cpp
--- a/dom/media/gmp/GMPLoader.cpp 2026-10-05 10:51:00.000000000 -0700
+++ b/dom/media/gmp/GMPLoader.cpp 2026-10-08 21:51:03.370275919 -0700
@@ -201,6 +201,15 @@
# endif
#endif

+#if defined(XP_LINUX) && !defined(__GLIBC__)
+ // For musl, load gcompat before loading plugins possibly distributed as
+ // glibc-linked binaries. Ignore failure to load.
+ PRLibSpec gcompat_libSpec;
+ gcompat_libSpec.type = PR_LibSpec_Pathname;
+ gcompat_libSpec.value.pathname = "libgcompat.so.0";
+ PR_LoadLibraryWithFlags(gcompat_libSpec, PR_LD_LAZY | PR_LD_GLOBAL);
+#endif
+
if (!getenv("MOZ_DISABLE_GMP_SANDBOX") && mSandboxStarter &&
!mSandboxStarter->Start(aUTF8LibPath)) {
MOZ_CRASH("Cannot start sandbox!");
@@ -278,6 +287,20 @@
}
bool Start(const char* aLibPath) override {
RegisterProfilerObserversForSandboxProfiler();
+
+#ifndef __GLIBC__
+ // For libcs other than glibc, ensure that the emulation of the glibc
+ // dynamic linker is already loaded so that the plugin does not attempt to
+ // load it later. Ignore failure to load.
+#if defined(__i386__)
+ PR_LoadLibrary("ld-linux.so.2");
+#elif defined(__x86_64__)
+ PR_LoadLibrary("ld-linux-x86-64.so.2");
+#elif defined(__aarch64__)
+ PR_LoadLibrary("ld-linux-aarch64.so.2");
+#endif
+#endif
+
mozilla::SetMediaPluginSandbox(aLibPath);
return true;
}
6 changes: 5 additions & 1 deletion srcpkgs/firefox/template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
pkgname=firefox
version=157.0.1
revision=1
revision=2
_llvmver=22
build_helper="rust"
hostmakedepends="unzip zip pkg-config perl python3
Expand Down Expand Up @@ -38,6 +38,10 @@ if [ "$XBPS_WORDSIZE" != "32" ]; then
build_options_default+=" debug"
fi

if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
depends+=" gcompat"
fi

desc_option_lto="Enable Link Time Optimization"
desc_option_pgo="Enable Profile-guided Optimization"
desc_option_clang="Build with clang"
Expand Down
Loading