From: Peter Michael Green Date: Sun, 15 Mar 2020 16:27:21 +0000 (+0000) Subject: Hack broken rust target selection so it produces the right target on raspbian. X-Git-Tag: archive/raspbian/1%68.6.0-1_deb10u1+rpi1~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b81842876bfbc4f3ee6d0a04fb3bdbaf8827711e;p=thunderbird.git Hack broken rust target selection so it produces the right target on raspbian. Gbp-Pq: Name raspbian-rust-triplet-hack.patch --- diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure index 9647cbc40e..0645c1e53a 100644 --- a/build/moz.configure/rust.configure +++ b/build/moz.configure/rust.configure @@ -185,6 +185,8 @@ def rust_compiler(rustc_info, cargo_info, build_project): @depends(rustc, when=rust_compiler) +@imports('sys') +@imports(_from='__builtin__', _import='repr') def rust_supported_targets(rustc): out = check_cmd_output(rustc, '--print', 'target-list').splitlines() # The os in the triplets used by rust may match the same OSes, in which @@ -192,7 +194,11 @@ def rust_supported_targets(rustc): per_os = {} ambiguous = set() per_raw_os = {} + #HACK: if there are multiple matches the algorithm uses the last one + #put arm-unknown-linux-gnuebihf on the end of the list so it gets preffered + out.append('arm-unknown-linux-gnueabihf') for t in out: + traw = t t = split_triplet(t, allow_unknown=True) endianness = t.endianness if t.cpu.startswith('thumb') and endianness not in ('big', 'little'): @@ -232,11 +238,13 @@ def rust_triple_alias(host_or_target): arm_target, when=rust_compiler) @checking('for rust %s triplet' % host_or_target_str) @imports('os') + @imports('sys') @imports('subprocess') @imports(_from='mozbuild.configure.util', _import='LineIO') @imports(_from='mozbuild.shellutil', _import='quote') @imports(_from='tempfile', _import='mkstemp') @imports(_from='textwrap', _import='dedent') + @imports(_from='__builtin__', _import='repr') def rust_target(rustc, host_or_target, compiler_info, rust_supported_targets, arm_target): # Rust's --target options are similar to, but not exactly the same