Skip to content

Commit 488f6bd

Browse files
shr-projectotavio
authored andcommitted
firefox: backport fix for newer rust
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
1 parent 92eee5b commit 488f6bd

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
# HG changeset patch
3+
# User Mike Hommey <mh+mozilla@glandium.org>
4+
# Date 1595261136 0
5+
# Node ID fb557eeb597737455524be7bed3fa6a3ea1b7408
6+
# Parent 7610647673d28bb487cb2032b72a09a729c86b20
7+
Bug 1640982 - Set CARGO_PROFILE_RELEASE_LTO=true when enabling rust LTO. r=rstewart, a=RyanVM
8+
9+
Differential Revision: https://phabricator.services.mozilla.com/D84098
10+
11+
diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
12+
--- a/config/makefiles/rust.mk
13+
+++ b/config/makefiles/rust.mk
14+
@@ -42,17 +42,21 @@ endif
15+
endif
16+
17+
# These flags are passed via `cargo rustc` and only apply to the final rustc
18+
# invocation (i.e., only the top-level crate, not its dependencies).
19+
cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
20+
ifndef DEVELOPER_OPTIONS
21+
ifndef MOZ_DEBUG_RUST
22+
# Enable link-time optimization for release builds.
23+
+# Pass -Clto for older versions of rust, and CARGO_PROFILE_RELEASE_LTO=true
24+
+# for newer ones that support it. Combining the latter with -Clto works, so
25+
+# set both everywhere.
26+
cargo_rustc_flags += -C lto
27+
+export CARGO_PROFILE_RELEASE_LTO=true
28+
endif
29+
endif
30+
31+
ifdef CARGO_INCREMENTAL
32+
export CARGO_INCREMENTAL
33+
endif
34+
35+
rustflags_neon =
36+

meta-firefox/recipes-browser/firefox/firefox_68.9.0esr.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ SRC_URI = "https://ftp.mozilla.org/pub/firefox/releases/${PV}/source/firefox-${P
2525
file://fixes/Bug-1556197-amend-Bug-1544631-for-fixing-mips32.patch \
2626
file://fixes/Bug-1560340-Only-add-confvars.sh-as-a-dependency-to-.patch \
2727
file://fixes/bug1545437-enable-to-specify-rust-target.patch \
28+
file://fixes/Bug-1640982-SetCARGO_PROFILE_RELEASE_LTO-true-when-e.patch \
2829
file://fixes/avoid-running-autoconf2.13.patch \
2930
file://fixes/pre-generated-old-configure.patch \
3031
file://fixes/link-with-libpangoft.patch \

0 commit comments

Comments
 (0)