Skip to content

Commit

Permalink
firefox: fix build on loongson3 (and possibly others)
Browse files Browse the repository at this point in the history
- (loongson3) Disable Clang due to missing ld.lld (linkage failure).
- (loongson3) Use the bfd linker.
- Make wasi-sysroot sandbox optional.
  • Loading branch information
MingcongBai committed Oct 30, 2023
1 parent 57e759f commit 2f23c68
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app-web/firefox/autobuild/defines
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions app-web/firefox/autobuild/mozconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions app-web/firefox/autobuild/prepare
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app-web/firefox/spec
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down

0 comments on commit 2f23c68

Please sign in to comment.