firefox: update to 135.0.

This commit is contained in:
Duncaen 2025-02-04 14:19:26 +01:00
parent 01f1d32c16
commit bb2a568aeb
No known key found for this signature in database
GPG key ID: 335C1D17EC3D6E35
2 changed files with 59 additions and 64 deletions

View file

@ -0,0 +1,18 @@
We need to pass --sysroot and --gcc-toolchain explicitly for cross compiling with glibc
because when the lld tries to link libc, it will read the gcc libc linker script which
includes absolute paths to actual libc files and without the sysroot argument it picks
the host ones, even though it discovered the linker script in the sysroot already.
linker-script = /usr/aarch64-linux-gnu/lib64/libc.so
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -725,6 +725,10 @@
flags.append("--target=%s" % toolchain)
has_target = True
+ if info.type == "clang" and not target.os == "WASI" and (info.cpu != target.cpu):
+ flags.append("--sysroot=/usr/%s" % toolchain)
+ flags.append("--gcc-toolchain=/usr")
+
if not has_target and (not info.cpu or info.cpu != target.cpu):
same_arch = same_arch_different_bits()
if (target.cpu, info.cpu) in same_arch:

View file

@ -3,7 +3,7 @@
# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/firefox-i18n". # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/firefox-i18n".
# #
pkgname=firefox pkgname=firefox
version=134.0 version=135.0
revision=1 revision=1
build_helper="rust" build_helper="rust"
short_desc="Mozilla Firefox web browser" short_desc="Mozilla Firefox web browser"
@ -12,29 +12,31 @@ license="MPL-2.0, GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://www.mozilla.org/firefox/" homepage="https://www.mozilla.org/firefox/"
changelog="https://www.mozilla.org/en-US/firefox/${version}/releasenotes/" changelog="https://www.mozilla.org/en-US/firefox/${version}/releasenotes/"
distfiles="${MOZILLA_SITE}/firefox/releases/${version/beta/b}/source/firefox-${version/beta/b}.source.tar.xz" distfiles="${MOZILLA_SITE}/firefox/releases/${version/beta/b}/source/firefox-${version/beta/b}.source.tar.xz"
checksum=ca88068bd72784c10de16df62359b2dc354672a1a427b4fd6a5fcdb34c06457e checksum=827e12a962ef47511089af4498f65ebf42fa57ca31db790bfd7e9a820d16b960
lib32disabled=yes lib32disabled=yes
_llvmver=19 # needs to match rust _llvmver=19 # needs to match rust
hostmakedepends="autoconf213 unzip zip pkg-config perl python3 yasm rust hostmakedepends="autoconf213 unzip zip pkg-config perl python3 yasm rust
cargo llvm${_llvmver} clang${_llvmver} lld${_llvmver} nodejs cbindgen nasm which tar cargo llvm${_llvmver} clang${_llvmver} lld${_llvmver} nodejs cbindgen nasm which
$(vopt_if pgo 'xvfb-run dbus')" tar xz $(vopt_if pgo 'xvfb-run dbus mesa-dri vulkan-loader pciutils')
$(vopt_if wasi wasi-sdk)"
makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel
pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
libXdamage-devel freetype-devel libXdamage-devel freetype-devel $(vopt_if wasi wasi-sdk)
$(vopt_if alsa alsa-lib-devel) $(vopt_if dbus dbus-glib-devel) $(vopt_if alsa alsa-lib-devel) $(vopt_if dbus dbus-glib-devel)
$(vopt_if pulseaudio pulseaudio-devel) $(vopt_if xscreensaver libXScrnSaver-devel) $(vopt_if pulseaudio pulseaudio-devel) $(vopt_if xscreensaver libXScrnSaver-devel)
$(vopt_if sndio sndio-devel) $(vopt_if jack jack-devel)" $(vopt_if sndio sndio-devel) $(vopt_if jack jack-devel)"
depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme" depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme pciutils"
conflicts="firefox-esr>=0" conflicts="firefox-esr>=0"
build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland lto pgo clang" build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland lto pgo clang wasi"
build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland clang" build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland clang wasi"
desc_option_lto="Enable Link Time Optimization" desc_option_lto="Enable Link Time Optimization"
desc_option_pgo="Enable Profile-guided Optimization" desc_option_pgo="Enable Profile-guided Optimization"
desc_option_clang="Build with clang" desc_option_clang="Build with clang"
desc_option_wasi="Build wasm sandboxed libraries"
case $XBPS_TARGET_MACHINE in case $XBPS_TARGET_MACHINE in
armv[56]*) broken="required NEON extensions are not supported on armv6" ;; armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
@ -42,6 +44,10 @@ case $XBPS_TARGET_MACHINE in
ppc*) broken="xptcall bitrot" ;; ppc*) broken="xptcall bitrot" ;;
esac esac
if [ "$CROSS_BUILD" -a "$build_option_pgo" ]; then
broken="pgo can't be enabled for cross-compilation"
fi
# we need this because cargo verifies checksums of all files in vendor # we need this because cargo verifies checksums of all files in vendor
# crates when it builds and gives us no way to override or update the # crates when it builds and gives us no way to override or update the
# file sanely... so just clear out the file list # file sanely... so just clear out the file list
@ -66,52 +72,6 @@ post_patch() {
} }
do_build() { do_build() {
if [ "$build_option_clang" ]; then
export CC=clang
export CXX=clang++
if [ "$CROSS_BUILD" ]; then
mkdir -p wrapper
local gcc_version=$(gcc -dumpversion)
local clang_version=$(clang -dumpversion)
cat <<-! >"wrapper/${XBPS_TARGET_MACHINE}-clang"
#!/bin/sh
exec clang \
--target="${XBPS_CROSS_TRIPLET}" \
--sysroot="${XBPS_CROSS_BASE}" \
--gcc-toolchain=/usr \
-isystem "${XBPS_CROSS_BASE}/usr/include" \
"\$@"
!
cat <<-! >"wrapper/${XBPS_TARGET_MACHINE}-clang++"
#!/bin/sh
exec clang++ \
--target="${XBPS_CROSS_TRIPLET}" \
--sysroot="${XBPS_CROSS_BASE}" \
--gcc-toolchain=/usr \
-isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}" \
-isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}/${XBPS_CROSS_TRIPLET}" \
-isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}/backward" \
-isystem "${XBPS_CROSS_BASE}/usr/include" \
"\$@"
!
chmod +x wrapper/*
export PATH="${wrksrc}/wrapper:$PATH"
export CC=${XBPS_TARGET_MACHINE}-clang
export CXX=${XBPS_TARGET_MACHINE}-clang++
fi
export AR=llvm-ar
export NM=llvm-nm
export HOST_CC=clang
export HOST_CXX=clang++
fi
export AS="${CC}" export AS="${CC}"
export CFLAGS="-O2" export CFLAGS="-O2"
export CXXFLAGS="-O2" export CXXFLAGS="-O2"
@ -120,6 +80,15 @@ do_build() {
export LDFLAGS="-Wl,-rpath=/usr/lib/firefox" export LDFLAGS="-Wl,-rpath=/usr/lib/firefox"
# export LDFLAGS+="-Wl,--threads=${XBPS_MAKEJOBS}" # export LDFLAGS+="-Wl,--threads=${XBPS_MAKEJOBS}"
if [ "$build_option_clang" ]; then
export CC=clang
export CXX=clang++
export AR=llvm-ar
export NM=llvm-nm
export HOST_CC=clang
export HOST_CXX=clang++
fi
disable_jemalloc() { disable_jemalloc() {
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
echo "ac_add_options --disable-jemalloc" echo "ac_add_options --disable-jemalloc"
@ -153,6 +122,14 @@ do_build() {
fi fi
} }
disable_wasi() {
if [ "$build_option_wasi" ]; then
echo "ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot"
else
echo "ac_add_options --without-wasm-sandboxed-libraries"
fi
}
cat <<-! >.mozconfig cat <<-! >.mozconfig
ac_add_options --prefix=/usr ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib ac_add_options --libdir=/usr/lib
@ -178,9 +155,7 @@ do_build() {
$(disable_elfhack) $(disable_elfhack)
$(disable_webrtc) $(disable_webrtc)
# XXX: wasi currently not ready $(disable_wasi)
# ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot
ac_add_options --without-wasm-sandboxed-libraries
ac_add_options --with-mozilla-api-keyfile="${wrksrc}/mozilla-api-key" ac_add_options --with-mozilla-api-keyfile="${wrksrc}/mozilla-api-key"
@ -208,6 +183,8 @@ do_build() {
ac_add_options $(vopt_enable sndio) ac_add_options $(vopt_enable sndio)
ac_add_options --enable-default-toolkit=$(vopt_if wayland 'cairo-gtk3-wayland' 'cairo-gtk3') ac_add_options --enable-default-toolkit=$(vopt_if wayland 'cairo-gtk3-wayland' 'cairo-gtk3')
mk_add_options MOZ_OBJDIR="${wrksrc}/obj"
MOZ_APP_REMOTINGNAME=Firefox MOZ_APP_REMOTINGNAME=Firefox
! !
@ -235,16 +212,16 @@ do_build() {
./mach build ./mach build
./mach package ./mach package
LLVM_PROFDATA=llvm-profdata JARLOG_FILE="$PWD/jarlog" \ LLVM_PROFDATA=llvm-profdata \
dbus-run-session \ JARLOG_FILE="$PWD/jarlog" \
GDK_BACKEND=x11 \
LD_LIBRARY_PATH="$PWD/obj/dist/firefox" \
XDG_RUNTIME_DIR="$(mktemp -d "${wrksrc}/pgo-runtime-XXXXXX")" \
MOZ_ENABLE_WAYLAND=0 \
xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \ xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \
./mach python build/pgo/profileserver.py dbus-run-session -- ./mach python build/pgo/profileserver.py
stat -c "Profile data found (%s bytes)" merged.profdata
test -s merged.profdata test -s merged.profdata
stat -c "Jar log found (%s bytes)" jarlog
test -s jarlog test -s jarlog
./mach clobber objdir ./mach clobber objdir