File mozilla-reduce-rust-debuginfo.patch of Package firefox78

# HG changeset patch
# User msirringhaus@suse.de
# Date 1560754926 -7200
#      Mon Jun 17 09:02:06 2019 +0200
# Node ID 428161c3b9599083e1b8710eda1760f1f707ab11
# Parent  83625bab561d09fb68aa2c71cea7cbafd9ec09b4
#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.

Index: b/build/moz.configure/toolchain.configure
===================================================================
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1875,8 +1875,8 @@ def rustc_opt_level(opt_level_option, mo
         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.
@@ -1899,6 +1899,8 @@ def rust_compile_flags(opt_level, debug_
 
     if debug_symbols:
         debug_info = '2'
+        if host.bitness == 32 or host.cpu == 'aarch64' or host.cpu == 'ppc64':
+            debug_info = '1'
 
     opts = []
 
openSUSE Build Service is sponsored by