Bug 1546438 - add -Clinker-plugin-lto for Rust target libraries when appropriate; r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D28509

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nathan Froyd 2019-04-26 09:39:02 +00:00
parent f104ce2b4a
commit 3ffe3911b3

View File

@ -126,11 +126,13 @@ export PKG_CONFIG_ALLOW_CROSS=1
export RUST_BACKTRACE=full
export MOZ_TOPOBJDIR=$(topobjdir)
TARGET_RECIPES := \
force-cargo-test-run \
$(foreach a,library program,$(foreach b,build check,force-cargo-$(a)-$(b)))
target_rust_ltoable := force-cargo-library-build
target_rust_nonltoable := force-cargo-test-run force-cargo-library-check $(foreach b,build check,force-cargo-program-$(b))
$(TARGET_RECIPES): RUSTFLAGS:=$(rustflags_override) $(RUSTFLAGS)
$(target_rust_ltoable): RUSTFLAGS:=$(rustflags_override) $(RUSTFLAGS) $(if $(MOZ_LTO_RUST),-Clinker-plugin-lto)
$(target_rust_nonltoable): RUSTFLAGS:=$(rustflags_override) $(RUSTFLAGS)
TARGET_RECIPES := $(target_rust_ltoable) $(target_rust_nonltoable)
HOST_RECIPES := \
$(foreach a,library program,$(foreach b,build check,force-cargo-host-$(a)-$(b)))