From 5cbb27444438bfd3d897b2e3dc304c365920ed5a Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sat, 15 Nov 2014 22:49:42 -0500 Subject: [PATCH] convert arch to what rust target specs wnat --- recipes/rust/rust.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index a2b4527..095702a 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -75,6 +75,15 @@ def cxxflags_for(d, thing): tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" return ' '.join([cc_arch, flags, tc]) +# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something +# rust's internals won't choke on. +def arch_to_rust_target_arch(arch): + if arch == "i586" or arch == "i686": + return "x86" + else: + return arch + + def as_json(list_): a = '[' for e in list_: @@ -126,7 +135,7 @@ def rust_gen_target(d, thing, wd): data_layout, llvm_target, target_word_size, - arch, + arch_to_rust_target_arch(arch), linker, features, as_json(pre_link_args)