diff --git a/srcpkgs/firefox/patches/gmp-sandbox-musl.patch b/srcpkgs/firefox/patches/gmp-sandbox-musl.patch new file mode 100644 index 00000000000000..767b34f78639ce --- /dev/null +++ b/srcpkgs/firefox/patches/gmp-sandbox-musl.patch @@ -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; + } diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template index e47b19720fbe82..c7fb945f2b7e71 100644 --- a/srcpkgs/firefox/template +++ b/srcpkgs/firefox/template @@ -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 @@ -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"