From 2f23c68314c05ec3b8bf4ea3761c3a654485489f Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Sun, 29 Oct 2023 18:09:00 +0000 Subject: [PATCH] firefox: fix build on loongson3 (and possibly others) - (loongson3) Disable Clang due to missing ld.lld (linkage failure). - (loongson3) Use the bfd linker. - Make wasi-sysroot sandbox optional. --- app-web/firefox/autobuild/defines | 4 ++-- app-web/firefox/autobuild/mozconfig | 4 ---- app-web/firefox/autobuild/prepare | 12 ++++++++++++ app-web/firefox/spec | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app-web/firefox/autobuild/defines b/app-web/firefox/autobuild/defines index 01ae9921392..e408b5a67c0 100644 --- a/app-web/firefox/autobuild/defines +++ b/app-web/firefox/autobuild/defines @@ -10,9 +10,9 @@ PKGDES="Standalone Web browser from Mozilla" PKGBREAK="firefox-i18n<=43.0.1" PKGREP="firefox-i18n<=43.0.1" -# FIXME: lld of llvm 15 in ppc64le failure for firefox. Skip for now. -# FIXME: ld.lld of llvm 15 complains about "relocation R_MIPS_64 cannot be used against local symbol" in loongson3. Skip for now USECLANG=1 +# FIXME: ld.lld is not available. +USECLANG__LOONGSON3=0 ABSPLITDBG=0 ABSTRIP=0 diff --git a/app-web/firefox/autobuild/mozconfig b/app-web/firefox/autobuild/mozconfig index eec121fceba..e3971238fe0 100644 --- a/app-web/firefox/autobuild/mozconfig +++ b/app-web/firefox/autobuild/mozconfig @@ -25,13 +25,9 @@ ac_add_options --allow-addon-sideload ac_add_options --with-google-location-service-api-keyfile="$SRCDIR"/autobuild/google-api-key ac_add_options --with-google-safebrowsing-api-keyfile="$SRCDIR"/autobuild/google-api-key -# WASI. -ac_add_options --with-wasi-sysroot=/usr/lib/wasm32-wasi/ - # Toolchain settings. ac_add_options --enable-release ac_add_options --disable-strip -ac_add_options --enable-linker=lld ac_add_options --enable-hardening ## Optimize diff --git a/app-web/firefox/autobuild/prepare b/app-web/firefox/autobuild/prepare index da66c140510..1e60cbc92cc 100644 --- a/app-web/firefox/autobuild/prepare +++ b/app-web/firefox/autobuild/prepare @@ -13,6 +13,18 @@ if ab_match_arch ppc64el; then >> "$SRCDIR"/autobuild/mozconfig fi +if ! ab_match_arch loongson3; then + echo "ac_add_options --enable-linker=lld" \ + >> "$SRCDIR"/autobuild/mozconfig + echo "ac_add_options --with-wasi-sysroot=/usr/lib/wasm32-wasi/" \ + >> "$SRCDIR"/autobuild/mozconfig +else + echo "ac_add_options --enable-linker=bfd" \ + >> "$SRCDIR"/autobuild/mozconfig + echo "ac_add_options --without-wasm-sandboxed-libraries" \ + >> "$SRCDIR"/autobuild/mozconfig +fi + cp -v "$SRCDIR"/{autobuild/,}mozconfig if [[ "${CROSS:-$ARCH}" = "powerpc" || "${CROSS:-$ARCH}" = "ppc64" ]]; then diff --git a/app-web/firefox/spec b/app-web/firefox/spec index bf67ab866d8..51d77e4b7f8 100644 --- a/app-web/firefox/spec +++ b/app-web/firefox/spec @@ -1,5 +1,5 @@ VER=117.0.1 -REL=1 +REL=2 CHKUPDATE="anitya::id=5506" SRCS="tbl::https://archive.mozilla.org/pub/firefox/releases/$VER/source/firefox-$VER.source.tar.xz \ file::rename=ach.xpi::https://archive.mozilla.org/pub/firefox/releases/$VER/linux-x86_64/xpi/ach.xpi \