Skip to content

Commit 3967ef3

Browse files
authored
add prefixes for x86 to support cross-compiling from non-x86 targets (#621)
otherwise cross-compiling from arm64 -> i686 fails, e.g. http://crossqa.debian.net/build/rustc_1.49.0+dfsg1-1_i386_20210907094750.log
1 parent 4942159 commit 3967ef3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,10 @@ impl Build {
25192519
"i586-unknown-linux-musl" => Some("musl"),
25202520
"i686-pc-windows-gnu" => Some("i686-w64-mingw32"),
25212521
"i686-uwp-windows-gnu" => Some("i686-w64-mingw32"),
2522+
"i686-unknown-linux-gnu" => self.find_working_gnu_prefix(&[
2523+
"i686-linux-gnu",
2524+
"x86_64-linux-gnu", // transparently support gcc-multilib
2525+
]), // explicit None if not found, so caller knows to fall back
25222526
"i686-unknown-linux-musl" => Some("musl"),
25232527
"i686-unknown-netbsd" => Some("i486--netbsdelf"),
25242528
"mips-unknown-linux-gnu" => Some("mips-linux-gnu"),
@@ -2586,6 +2590,9 @@ impl Build {
25862590
"x86_64-pc-windows-gnu" => Some("x86_64-w64-mingw32"),
25872591
"x86_64-uwp-windows-gnu" => Some("x86_64-w64-mingw32"),
25882592
"x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"),
2593+
"x86_64-unknown-linux-gnu" => self.find_working_gnu_prefix(&[
2594+
"x86_64-linux-gnu", // rustfmt wrap
2595+
]), // explicit None if not found, so caller knows to fall back
25892596
"x86_64-unknown-linux-musl" => Some("musl"),
25902597
"x86_64-unknown-netbsd" => Some("x86_64--netbsd"),
25912598
_ => None,

0 commit comments

Comments
 (0)