Bug 1652448 - Use the same codegen-units numbers on host and target rust builds. r=firefox-build-system-reviewers,rstewart

Otherwise, crates that are shared between host and target are always
rebuilt because of the difference in rust flags.

Differential Revision: https://phabricator.services.mozilla.com/D83412
This commit is contained in:
Mike Hommey 2020-07-13 22:24:59 +00:00
Родитель 5cdf58ff2a
Коммит 0ebe2bbd8f
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -189,18 +189,18 @@ $(target_rust_nonltoable): RUSTFLAGS:=$(rustflags_override) $(rustflags_sancov)
TARGET_RECIPES := $(target_rust_ltoable) $(target_rust_nonltoable)
# If this is a release build we want rustc to generate one codegen unit per
# crate. This results in better optimization and less code duplication at the
# cost of longer compile times.
ifndef DEVELOPER_OPTIONS
$(TARGET_RECIPES): RUSTFLAGS += -C codegen-units=1
endif
HOST_RECIPES := \
$(foreach a,library program,$(foreach b,build check,force-cargo-host-$(a)-$(b)))
$(HOST_RECIPES): RUSTFLAGS:=$(rustflags_override)
# If this is a release build we want rustc to generate one codegen unit per
# crate. This results in better optimization and less code duplication at the
# cost of longer compile times.
ifndef DEVELOPER_OPTIONS
$(TARGET_RECIPES) $(HOST_RECIPES): RUSTFLAGS += -C codegen-units=1
endif
cargo_env = $(subst -,_,$(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$1)))))))))))))))))))))))))))
# We use the + prefix to pass down the jobserver fds to cargo, but we