--- a/mozilla-reduce-rust-debuginfo.patch Sun Oct 20 14:25:55 2019 +0200
+++ b/mozilla-reduce-rust-debuginfo.patch Fri Oct 25 11:19:31 2019 +0200
@@ -3,27 +3,42 @@
# Date 1560754926 -7200
# Mon Jun 17 09:02:06 2019 +0200
# Node ID 428161c3b9599083e1b8710eda1760f1f707ab11
-# Parent 6cd963b6c82ea6629aaf4050851789b78f310338
+# Parent fa1cf8b9cb4efdf89fe19e543fb54272b726a353
#Description: reduce the rust debuginfo level on selected architectures where
# compiling with debuginfo=2 causes the OOM killer to interrupt the build on
# launchpad builders. Initially this was only on 32 bit architectures, but with
# firefox 63 it started happening frequently on arm64 and ppc64el too.
-diff -r 6cd963b6c82e -r 428161c3b959 build/moz.configure/toolchain.configure
---- a/build/moz.configure/toolchain.configure Tue May 21 17:26:58 2019 +0200
-+++ b/build/moz.configure/toolchain.configure Mon Jun 17 09:02:06 2019 +0200
-@@ -1865,8 +1865,8 @@
+diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
+--- a/build/moz.configure/toolchain.configure
++++ b/build/moz.configure/toolchain.configure
+@@ -1861,18 +1861,18 @@ imply_option('RUSTC_OPT_LEVEL', '2', whe
+ @depends('RUSTC_OPT_LEVEL', moz_optimize)
+ def rustc_opt_level(opt_level_option, moz_optimize):
+ if opt_level_option:
+ return opt_level_option[0]
+ else:
return '1' if moz_optimize.optimize else '0'
--@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols')
--def rust_compile_flags(opt_level, debug_rust, debug_symbols):
-+@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', host)
-+def rust_compile_flags(opt_level, debug_rust, debug_symbols, host):
+-@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers')
+-def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers):
++@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers', host)
++def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers, host):
# Cargo currently supports only two interesting profiles for building:
# development and release. Those map (roughly) to --enable-debug and
# --disable-debug in Gecko, respectively.
-@@ -1889,6 +1889,8 @@
+ #
+ # But we'd also like to support an additional axis of control for
+ # optimization level. Since Cargo only supports 2 profiles, we're in
+ # a bit of a bind.
+ #
+@@ -1885,16 +1885,18 @@ def rust_compile_flags(opt_level, debug_
+
+ # opt-level=0 implies -C debug-assertions, which may not be desired
+ # unless Rust debugging is enabled.
+ if opt_level == '0' and not debug_rust:
+ debug_assertions = False
if debug_symbols:
debug_info = '2'
@@ -32,3 +47,8 @@
opts = []
+ if opt_level is not None:
+ opts.append('opt-level=%s' % opt_level)
+ if debug_assertions is not None:
+ opts.append('debug-assertions=%s' %
+ ('yes' if debug_assertions else 'no'))