Skip to content

Commit

Permalink
LTO: Only enable LTO for Rust when complete build uses LTO
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
  • Loading branch information
Whissi authored and Thaodan committed Mar 6, 2023
1 parent f4d3916 commit 62122dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/makefiles/rust.mk
Expand Up @@ -82,6 +82,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
Expand All @@ -101,6 +102,7 @@ endif
endif
endif
endif
endif

ifdef CARGO_INCREMENTAL
export CARGO_INCREMENTAL
Expand Down

0 comments on commit 62122dd

Please sign in to comment.