mozilla-reduce-rust-debuginfo.patch
branchfirefox91
changeset 1160 b28cf22ff7cf
parent 1159 c4aba2fa0908
child 1171 130d464159be
equal deleted inserted replaced
1159:c4aba2fa0908 1160:b28cf22ff7cf
     1 # HG changeset patch
       
     2 # User msirringhaus@suse.de
       
     3 # Date 1560754926 -7200
       
     4 #      Mon Jun 17 09:02:06 2019 +0200
       
     5 # Node ID 428161c3b9599083e1b8710eda1760f1f707ab11
       
     6 # Parent  d55730171edb1935dec80234eba336787ff0e4e8
       
     7 #Description: reduce the rust debuginfo level on selected architectures where
       
     8 # compiling with debuginfo=2 causes the OOM killer to interrupt the build on
       
     9 # launchpad builders. Initially this was only on 32 bit architectures, but with
       
    10 # firefox 63 it started happening frequently on arm64 and ppc64el too.
       
    11 
       
    12 diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
     1 diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
    13 --- a/build/moz.configure/rust.configure
     2 --- a/build/moz.configure/rust.configure
    14 +++ b/build/moz.configure/rust.configure
     3 +++ b/build/moz.configure/rust.configure
    15 @@ -603,18 +603,19 @@ set_config("CARGO_PROFILE_DEV_OPT_LEVEL"
     4 @@ -610,6 +610,7 @@ set_config("CARGO_PROFILE_DEV_OPT_LEVEL"
    16  
       
    17  
       
    18  @depends(
       
    19      rustc_opt_level,
       
    20      debug_rust,
       
    21      target,
       
    22      "--enable-debug-symbols",
       
    23      "--enable-frame-pointers",
     5      "--enable-frame-pointers",
    24 +    host,
     6      path_remapping,
       
     7      path_remappings,
       
     8 +    host
    25  )
     9  )
    26 -def rust_compile_flags(opt_level, debug_rust, target, debug_symbols, frame_pointers):
    10  def rust_compile_flags(
    27 +def rust_compile_flags(opt_level, debug_rust, target, debug_symbols, frame_pointers, host):
    11      opt_level,
       
    12 @@ -619,6 +620,7 @@ def rust_compile_flags(
       
    13      frame_pointers,
       
    14      path_remapping,
       
    15      path_remappings,
       
    16 +    host
       
    17  ):
    28      # Cargo currently supports only two interesting profiles for building:
    18      # Cargo currently supports only two interesting profiles for building:
    29      # development and release. Those map (roughly) to --enable-debug and
    19      # development and release. Those map (roughly) to --enable-debug and
    30      # --disable-debug in Gecko, respectively.
    20 @@ -642,6 +644,8 @@ def rust_compile_flags(
    31      #
       
    32      # But we'd also like to support an additional axis of control for
       
    33      # optimization level. Since Cargo only supports 2 profiles, we're in
       
    34      # a bit of a bind.
       
    35      #
       
    36 @@ -627,16 +628,18 @@ def rust_compile_flags(opt_level, debug_
       
    37  
       
    38      # opt-level=0 implies -C debug-assertions, which may not be desired
       
    39      # unless Rust debugging is enabled.
       
    40      if opt_level == "0" and not debug_rust:
       
    41          debug_assertions = False
       
    42  
    21  
    43      if debug_symbols:
    22      if debug_symbols:
    44          debug_info = "2"
    23          debug_info = "2"
    45 +        if host.bitness == 32 or host.cpu == 'aarch64' or host.cpu == 'ppc64':
    24 +        if host.bitness == 32 or host.cpu == 'aarch64' or host.cpu == 'ppc64' or host.cpu == 's390x':
    46 +            debug_info = '1'
    25 +            debug_info = '1'
    47  
    26  
    48      opts = []
    27      opts = []
    49  
    28  
    50      if debug_assertions is not None:
       
    51          opts.append("debug-assertions=%s" % ("yes" if debug_assertions else "no"))
       
    52      if debug_info is not None:
       
    53          opts.append("debuginfo=%s" % debug_info)
       
    54      if frame_pointers: