diff options
Diffstat (limited to 'source/xap')
3 files changed, 67 insertions, 14 deletions
diff --git a/source/xap/mozilla-firefox/0027-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch b/source/xap/mozilla-firefox/0027-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch new file mode 100644 index 00000000..387a65ad --- /dev/null +++ b/source/xap/mozilla-firefox/0027-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch @@ -0,0 +1,34 @@ +From 8ae6defd8340a13d88977d9973abd79495a99fcd Mon Sep 17 00:00:00 2001 +From: Thomas Deutschmann <whissi@gentoo.org> +Date: Sat, 29 Aug 2020 22:30:59 +0200 +Subject: [PATCH 27/30] LTO: Only enable LTO for Rust when complete build uses + LTO + +Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> +--- + config/makefiles/rust.mk | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk +index 92f3070a85..0d72914c43 100644 +--- a/config/makefiles/rust.mk ++++ b/config/makefiles/rust.mk +@@ -64,6 +64,7 @@ endif + # These flags are passed via `cargo rustc` and only apply to the final rustc + # invocation (i.e., only the top-level crate, not its dependencies). + cargo_rustc_flags = $(CARGO_RUSTCFLAGS) ++ifdef MOZ_LTO + ifndef DEVELOPER_OPTIONS + ifndef MOZ_DEBUG_RUST + # Enable link-time optimization for release builds, but not when linking +@@ -77,6 +78,7 @@ RUSTFLAGS += -Cembed-bitcode=yes + endif + endif + endif ++endif + + ifdef CARGO_INCREMENTAL + export CARGO_INCREMENTAL +-- +2.31.0 + diff --git a/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild b/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild index d95b38ba..b589706f 100755 --- a/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild +++ b/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -88,13 +88,20 @@ fi export CC=${CC:-clang} export CXX=${CXX:-clang++} -# Keep memory usage as low as possible when linking: -SLKLDFLAGS=" -Wl,--as-needed -Wl,--no-keep-memory -Wl,--stats -Wl,--reduce-memory-overheads" -export LDFLAGS="$SLKLDFLAGS" -export MOZ_LINK_FLAGS="$SLKLDFLAGS" - # Set linker to use: -LINKER=bfd +if [ "$CC" = "clang" ]; then + # Upstream default: + LINKER=lld +else + LINKER=bfd +fi + +# Keep memory usage as low as possible when linking: +if [ ! "$LINKER" = "lld" ]; then + SLKLDFLAGS=" -Wl,--as-needed -Wl,--no-keep-memory -Wl,--stats -Wl,--reduce-memory-overheads" + export LDFLAGS="$SLKLDFLAGS" + export MOZ_LINK_FLAGS="$SLKLDFLAGS" +fi # Put Rust objects on a diet to keep the linker from running into memory # issues (especially on 32-bit): @@ -198,6 +205,9 @@ sed -i.allow-warnings -e '/#!\[deny(warnings)\]/a #![allow(unused_imports)]' \ # Retain GTK+ v2 scrolling behavior: zcat $CWD/ff.ui.scrollToClick.diff.gz | patch -p1 --verbose || exit 1 +# Don't enable LTO for Rust unless the whole build uses it: +zcat $CWD/0027-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch.gz | patch -p1 --verbose || exit 1 + # Fetch localization, if requested # https://bugzilla.mozilla.org/show_bug.cgi?id=1256955 if [ ! -z $MOZLOCALIZE ]; then @@ -238,6 +248,7 @@ OPTIONS="\ --disable-crashreporter \ --disable-debug-symbols \ --disable-debug \ + --disable-elf-hack \ --disable-updater \ --disable-optimize" # Complains about missing APNG support in Slackware's libpng: diff --git a/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild b/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild index 469b0e32..e81df3bd 100755 --- a/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild +++ b/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2008, 2009, 2010, 2011, 2012, 2014, 2016, 2017, 2018, 2019, 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2008, 2009, 2010, 2011, 2012, 2014, 2016, 2017, 2018, 2019, 2020, 2021 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -117,13 +117,20 @@ fi export CC=${CC:-clang} export CXX=${CXX:-clang++} -# Keep memory usage as low as possible when linking: -SLKLDFLAGS=" -Wl,--as-needed -Wl,--no-keep-memory -Wl,--stats -Wl,--reduce-memory-overheads" -export LDFLAGS="$SLKLDFLAGS" -export MOZ_LINK_FLAGS="$SLKLDFLAGS" - # Set linker to use: -LINKER=bfd +if [ "$CC" = "clang" ]; then + # Upstream default: + LINKER=lld +else + LINKER=bfd +fi + +# Keep memory usage as low as possible when linking: +if [ ! "$LINKER" = "lld" ]; then + SLKLDFLAGS=" -Wl,--as-needed -Wl,--no-keep-memory -Wl,--stats -Wl,--reduce-memory-overheads" + export LDFLAGS="$SLKLDFLAGS" + export MOZ_LINK_FLAGS="$SLKLDFLAGS" +fi # Put Rust objects on a diet to keep the linker from running into memory # issues (especially on 32-bit): @@ -219,6 +226,7 @@ OPTIONS="\ --disable-crashreporter \ --disable-debug-symbols \ --disable-debug \ + --disable-elf-hack \ --disable-tests \ --disable-updater \ --host=$ARCH-slackware-linux \ |