Skip to content

Commit 9b664f3

Browse files
committed
When running a 32-bit rustup on an aarch64 CPU, select a 32-bit toolchain
this mirrors a similar check that exists in rustup-init.sh fixes #3307
1 parent d4c6844 commit 9b664f3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/dist/dist.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,13 @@ impl TargetTriple {
346346
(b"Linux", b"arm") => Some("arm-unknown-linux-gnueabi"),
347347
(b"Linux", b"armv7l") => Some("armv7-unknown-linux-gnueabihf"),
348348
(b"Linux", b"armv8l") => Some("armv7-unknown-linux-gnueabihf"),
349-
(b"Linux", b"aarch64") => Some(TRIPLE_AARCH64_UNKNOWN_LINUX),
349+
(b"Linux", b"aarch64") => {
350+
if cfg!(target_pointer_width = "32") {
351+
Some("armv7-unknown-linux-gnueabihf")
352+
} else {
353+
Some(TRIPLE_AARCH64_UNKNOWN_LINUX)
354+
}
355+
}
350356
(b"Darwin", b"x86_64") => Some("x86_64-apple-darwin"),
351357
(b"Darwin", b"i686") => Some("i686-apple-darwin"),
352358
(b"FreeBSD", b"x86_64") => Some("x86_64-unknown-freebsd"),

0 commit comments

Comments
 (0)