reduce the rust debuginfo level on selected architectures
authorCarsten Schoenert <c.schoenert@t-online.de>
Wed, 30 Sep 2020 15:21:27 +0000 (17:21 +0200)
committerCarsten Schoenert <c.schoenert@t-online.de>
Thu, 3 Dec 2020 07:35:07 +0000 (07:35 +0000)
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, and with
newer versions it started happening very frequently on s390x too.

Patch cherry-picked from Ubuntu.

Gbp-Pq: Topic fixes
Gbp-Pq: Name reduce-the-rust-debuginfo-level-on-selected-architectures.patch

build/moz.configure/toolchain.configure

index 91736eae120eacba77ce035c5d24a3828f5e5d9a..71fc2722e5b8bee6d22033052d64a8a0397f56b5 100755 (executable)
@@ -1873,8 +1873,8 @@ def rustc_opt_level(opt_level_option, moz_optimize):
         return '1' if moz_optimize.optimize else '0'
 
 
-@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.
@@ -1897,6 +1897,8 @@ def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers):
 
     if debug_symbols:
         debug_info = '2'
+        if host.bitness == 32 or host.cpu in ('aarch64', 'ppc64', 's390x', 'x86'):
+            debug_info = '1'
 
     opts = []