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
|
1123
|
6 |
# Parent 83625bab561d09fb68aa2c71cea7cbafd9ec09b4
|
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
|
1123
|
15 |
@@ -1823,18 +1823,18 @@ imply_option('RUSTC_OPT_LEVEL', '2', whe
|
1112
|
16 |
@depends('RUSTC_OPT_LEVEL', moz_optimize)
|
|
17 |
def rustc_opt_level(opt_level_option, moz_optimize):
|
|
18 |
if opt_level_option:
|
|
19 |
return opt_level_option[0]
|
|
20 |
else:
|
1097
|
21 |
return '1' if moz_optimize.optimize else '0'
|
|
22 |
|
|
23 |
|
1112
|
24 |
-@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers')
|
|
25 |
-def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers):
|
|
26 |
+@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers', host)
|
|
27 |
+def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers, host):
|
1097
|
28 |
# Cargo currently supports only two interesting profiles for building:
|
|
29 |
# development and release. Those map (roughly) to --enable-debug and
|
|
30 |
# --disable-debug in Gecko, respectively.
|
1112
|
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 |
#
|
1123
|
36 |
@@ -1847,16 +1847,18 @@ def rust_compile_flags(opt_level, debug_
|
1112
|
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
|
1097
|
42 |
|
|
43 |
if debug_symbols:
|
|
44 |
debug_info = '2'
|
|
45 |
+ if host.bitness == 32 or host.cpu == 'aarch64' or host.cpu == 'ppc64':
|
|
46 |
+ debug_info = '1'
|
|
47 |
|
|
48 |
opts = []
|
|
49 |
|
1112
|
50 |
if opt_level is not None:
|
|
51 |
opts.append('opt-level=%s' % opt_level)
|
|
52 |
if debug_assertions is not None:
|
|
53 |
opts.append('debug-assertions=%s' %
|
|
54 |
('yes' if debug_assertions else 'no'))
|