gecko-dev/config
Mike Hommey 2a4eb30ed4 Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO. r=firefox-build-system-reviewers,rstewart
It turns out setting CARGO_PROFILE_RELEASE_LTO has unwanted side
effects.

First it's not actually strictly equivalent to using `cargo rustc --
-Clto`. For instance, it apparently also enables cross-language LTO in
newer versions of cargo.

Second, it changes the rust computed hash for all the dependencies of
the crate being built with the variable set, which makes them diverge
from when the same dependencies are built through another crate in the
tree that is not LTOed. This effectively makes us build a _lot_ of
crates twice, many of which are not cacheable.

Since the original problem is that cargo >= 1.45 passes extra flags (`-C
embed-bitcode=no`) to rustc that are incompatible with `-Clto`, and while
it knows to adjust based on the `lto` setting in the build profile
(which CARGO_PROFILE_RELEASE_LTO overrides the default of), cargo
ignores flags passed via `cargo rustc -- ...` when making those
adjustments.

So, we need to override with `-C embed-bitcode=yes` on our own at the
same time we pass `-Clto`. But doing that through `cargo rustc -- ...`
is not enough because all the dependencies of the crate built with
`-Clto` need to be built with `-C embed-bitcode=yes`. So we need to
override with `RUSTFLAGS`, which will affect all the dependencies.
But we also need to do this consistently across all crates, not only the
dependencies of crates built with `-Clto`, otherwise we'd still end up
building crates twice (once with and once without the override).

Unfortunately, the `-C embed-bitcode=*` flag is also not supported in
versions older than 1.45, so we have to avoid adding it on older
versions.

We unfortunately support a large range of versions of rustc (albeit only
for tools/crashreporter), but we actually need to upgrade the smaller
supported version because rustc < 1.38 doesn't support our top-level
Cargo.lock. This makes the version check slightly less awful.

Differential Revision: https://phabricator.services.mozilla.com/D84652
2020-07-27 21:23:57 +00:00
..
Moz
external Bug 1264836 - Automatically convert the little-endian ICU data file for big-endian builds. r=firefox-build-system-reviewers,rstewart 2020-07-17 22:25:57 +00:00
faster Bug 1641291 - Part 2: Make NSDISTMODE=copy impact install manifests. r=glandium 2020-07-07 02:16:12 +00:00
makefiles Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO. r=firefox-build-system-reviewers,rstewart 2020-07-27 21:23:57 +00:00
mozunit Bug 1640902 - [python-test] Add ability to mark tests as "slow" and an arugment to run them, r=raphael 2020-07-09 17:46:07 +00:00
tests Bug 1644228 - Remove support for IMPACTED_TESTS; r=remote-protocol-reviewers,firefox-build-system-reviewers,rstewart,whimboo 2020-06-12 08:04:08 +00:00
AB_rCD.mk
Makefile.in
MozZipFile.py
autoconf-js.mk.in
autoconf.mk.in
baseconfig.mk Bug 1651287 - Add a pre-compile pseudo-tier. r=firefox-build-system-reviewers,rstewart 2020-07-11 22:18:25 +00:00
check_js_msg_encoding.py Bug 1633016 - Remove a bunch of references to PYTHON(2) in Makefiles r=glandium 2020-05-05 19:53:22 +00:00
check_js_opcode.py
check_macroassembler_style.py
check_source_count.py
check_spidermonkey_style.py Bug 1496584 - Part 2: Include previously disabled date-interval formatters. r=jwalden 2020-07-01 11:19:52 +00:00
check_vanilla_allocations.py Bug 1632916 - Run JS/web-platform/ipdl build machinery in Python 3 r=jgraham,nika,glandium 2020-05-05 20:32:12 +00:00
config.mk Bug 1651608 - Remove leftovers from bug 1557788. r=froydnj 2020-07-09 12:19:58 +00:00
createprecomplete.py
emptyvars-js.mk.in
emptyvars.mk.in
gcc-stl-wrapper.template.h
gcc_hidden.h
install.bat
make-stl-wrappers.py
make-system-wrappers.py
make-windows-h-wrapper.py
milestone.txt Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2020-07-27 17:45:43 +00:00
moz.build Bug 1646936 - Generate a single metadata file in the objdir, and feed it to cbindgen. r=glandium 2020-06-26 10:41:26 +00:00
msvc-stl-wrapper.template.h
nsinstall.c
nsinstall.py Bug 1651731: [lint] Python and shell files without `#!` should not be executable; r=linter-reviewers,perftest-reviewers,geckoview-reviewers,agi,sylvestre,sparky 2020-07-09 20:29:18 +00:00
pathsub.c
pathsub.h
printconfigsetting.py
printprereleasesuffix.py
rebuild_check.py Bug 1633016 - Remove a bunch of references to PYTHON(2) in Makefiles r=glandium 2020-05-05 19:53:22 +00:00
recurse.mk Bug 1653909 - Use the stub file for the icu data file dependencies. r=froydnj 2020-07-21 13:13:02 +00:00
rules.mk Bug 1651608 - Remove leftovers from bug 1557788. r=froydnj 2020-07-09 12:19:58 +00:00
run-and-prefix.py Bug 1633016 - Remove a bunch of references to PYTHON(2) in Makefiles r=glandium 2020-05-05 19:53:22 +00:00
run_spidermonkey_checks.py
static-checking-config.mk
stl-headers.mozbuild
system-headers.mozbuild Bug 1496584 - Part 2: Include previously disabled date-interval formatters. r=jwalden 2020-07-01 11:19:52 +00:00
version.mk
version_win.pl
windows-h-constant.decls.h
windows-h-unicode.decls.h
windows-h-wrapper.template.h