Bug 1409680 - Extend --disable-debug-symbols to Rust code. r?glandium draft
authorJan Beich <jbeich@FreeBSD.org>
Wed, 18 Oct 2017 08:38:54 +0000
changeset 682261 c7a4f52b3993eecd5469110ab7e44278eb91b427
parent 682167 4efa95ae9141a1973b2cdc026f315691f4e3d7ea
child 736345 e7dc39d404371b21e627ef765518356acae94293
push id85050
push userbmo:jbeich@FreeBSD.org
push dateWed, 18 Oct 2017 10:36:10 +0000
reviewersglandium
bugs1409680
milestone58.0a1
Bug 1409680 - Extend --disable-debug-symbols to Rust code. r?glandium This reduces disk I/O and memory usage during build that already lacks debugging symbols from C++ code, allowing to use more jobs on 32bit hosts. --disable-debug-symbols build on FreeBSD 10.3 i386 (8 cores) host: Max RSS before: libxul - 612 Mb, libgkrust - 1908 Mb Max RSS after: libxul - 444 Mb, libgkrust - 1471 Mb Binary before: libxul - 203 Mb, libgkrust - 732 Mb Binary after: libxul - 123 Mb, libgkrust - 301 Mb MozReview-Commit-ID: 40UEYuKddZ2
config/rules.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -914,17 +914,19 @@ rust_unlock_unstable =
 ifdef MOZ_RUST_SIMD
 rust_unlock_unstable += RUSTC_BOOTSTRAP=1
 endif
 
 ifdef MOZ_USING_SCCACHE
 sccache_wrap := RUSTC_WRAPPER='$(CCACHE)'
 endif
 
+ifdef MOZ_DEBUG_SYMBOLS
 default_rustflags += -C debuginfo=2
+endif
 
 # We use the + prefix to pass down the jobserver fds to cargo, but we
 # don't use the prefix when make -n is used, so that cargo doesn't run
 # in that case)
 define RUN_CARGO
 $(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleaner) $(rust_unlock_unstable) $(rustflags_override) $(sccache_wrap) \
 	CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
 	RUSTC=$(RUSTC) \