1097
|
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
|
1152
|
6 |
# Parent f5e9431a99bb1d122ccd76411f08ac6f3236c19f
|
1097
|
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 |
|
1112
|
12 |
diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
|
|
13 |
--- a/build/moz.configure/toolchain.configure
|
|
14 |
+++ b/build/moz.configure/toolchain.configure
|
1152
|
15 |
@@ -2138,19 +2138,19 @@ imply_option("RUSTC_OPT_LEVEL", "2", whe
|
1112
|
16 |
def rustc_opt_level(opt_level_option, moz_optimize):
|
|
17 |
if opt_level_option:
|
|
18 |
return opt_level_option[0]
|
|
19 |
else:
|
1152
|
20 |
return "1" if moz_optimize.optimize else "0"
|
1097
|
21 |
|
|
22 |
|
1152
|
23 |
@depends(
|
|
24 |
- rustc_opt_level, debug_rust, "--enable-debug-symbols", "--enable-frame-pointers"
|
|
25 |
+ rustc_opt_level, debug_rust, "--enable-debug-symbols", "--enable-frame-pointers", host
|
|
26 |
)
|
1112
|
27 |
-def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers):
|
|
28 |
+def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers, host):
|
1097
|
29 |
# Cargo currently supports only two interesting profiles for building:
|
|
30 |
# development and release. Those map (roughly) to --enable-debug and
|
|
31 |
# --disable-debug in Gecko, respectively.
|
1112
|
32 |
#
|
|
33 |
# But we'd also like to support an additional axis of control for
|
|
34 |
# optimization level. Since Cargo only supports 2 profiles, we're in
|
|
35 |
# a bit of a bind.
|
|
36 |
#
|
1152
|
37 |
@@ -2163,16 +2163,18 @@ def rust_compile_flags(opt_level, debug_
|
1112
|
38 |
|
|
39 |
# opt-level=0 implies -C debug-assertions, which may not be desired
|
|
40 |
# unless Rust debugging is enabled.
|
1152
|
41 |
if opt_level == "0" and not debug_rust:
|
1112
|
42 |
debug_assertions = False
|
1097
|
43 |
|
|
44 |
if debug_symbols:
|
1152
|
45 |
debug_info = "2"
|
1097
|
46 |
+ if host.bitness == 32 or host.cpu == 'aarch64' or host.cpu == 'ppc64':
|
|
47 |
+ debug_info = '1'
|
|
48 |
|
|
49 |
opts = []
|
|
50 |
|
1112
|
51 |
if opt_level is not None:
|
1152
|
52 |
opts.append("opt-level=%s" % opt_level)
|
1112
|
53 |
if debug_assertions is not None:
|
1152
|
54 |
opts.append("debug-assertions=%s" % ("yes" if debug_assertions else "no"))
|
|
55 |
if debug_info is not None:
|