2020-07-28 04:41:23 +00:00
|
|
|
From cb5b4585486a52d06315a800f9e4ed96f2677898 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Mike Hommey <mh+mozilla@glandium.org>
|
|
|
|
Date: Mon, 20 Jul 2020 16:05:36 +0000
|
|
|
|
Subject: [PATCH] Bug 1640982 - Set CARGO_PROFILE_RELEASE_LTO=true when
|
|
|
|
enabling rust LTO. r=firefox-build-system-reviewers,rstewart
|
|
|
|
|
|
|
|
Differential Revision: https://phabricator.services.mozilla.com/D84098
|
|
|
|
---
|
|
|
|
config/makefiles/rust.mk | 4 ++++
|
|
|
|
1 file changed, 4 insertions(+)
|
|
|
|
|
2020-07-27 22:14:01 +00:00
|
|
|
diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
|
2020-07-28 04:41:23 +00:00
|
|
|
index 82182ffdf30fe..4b4a679593377 100644
|
2020-07-27 22:14:01 +00:00
|
|
|
--- a/config/makefiles/rust.mk
|
|
|
|
+++ b/config/makefiles/rust.mk
|
2020-07-28 04:41:23 +00:00
|
|
|
@@ -61,7 +61,11 @@ ifndef MOZ_DEBUG_RUST
|
2020-07-27 22:14:01 +00:00
|
|
|
# Enable link-time optimization for release builds, but not when linking
|
|
|
|
# gkrust_gtest.
|
|
|
|
ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
|
|
|
|
+# Pass -Clto for older versions of rust, and CARGO_PROFILE_RELEASE_LTO=true
|
|
|
|
+# for newer ones that support it. Combining the latter with -Clto works, so
|
|
|
|
+# set both everywhere.
|
|
|
|
cargo_rustc_flags += -Clto
|
|
|
|
+export CARGO_PROFILE_RELEASE_LTO=true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|