Skip to content

Commit

Permalink
add prefixes for x86 to support cross-compiling from non-x86 targets
Browse files Browse the repository at this point in the history
otherwise cross-compiling from arm64 -> i686 fails, e.g. http://crossqa.debian.net/build/rustc_1.49.0+dfsg1-1_i386_20210907094750.log
  • Loading branch information
infinity0 committed Oct 6, 2021
1 parent 114437e commit 62654fd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib.rs
Expand Up @@ -2504,6 +2504,10 @@ impl Build {
"i586-unknown-linux-musl" => Some("musl"),
"i686-pc-windows-gnu" => Some("i686-w64-mingw32"),
"i686-uwp-windows-gnu" => Some("i686-w64-mingw32"),
"i686-unknown-linux-gnu" => self.find_working_gnu_prefix(&[
"i686-linux-gnu",
"x86_64-linux-gnu", // transparently support gcc-multilib
]), // explicit None if not found, so caller knows to fall back
"i686-unknown-linux-musl" => Some("musl"),
"i686-unknown-netbsd" => Some("i486--netbsdelf"),
"mips-unknown-linux-gnu" => Some("mips-linux-gnu"),
Expand Down Expand Up @@ -2571,6 +2575,9 @@ impl Build {
"x86_64-pc-windows-gnu" => Some("x86_64-w64-mingw32"),
"x86_64-uwp-windows-gnu" => Some("x86_64-w64-mingw32"),
"x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"),
"x86_64-unknown-linux-gnu" => self.find_working_gnu_prefix(&[
"x86_64-linux-gnu"
]), // explicit None if not found, so caller knows to fall back
"x86_64-unknown-linux-musl" => Some("musl"),
"x86_64-unknown-netbsd" => Some("x86_64--netbsd"),
_ => None,
Expand Down

0 comments on commit 62654fd

Please sign in to comment.