Skip to content

rust 1.89.0 cross-build failure for aarch64_be (big-endian aarch64) #145230

@he32

Description

@he32

I am doing the rounds of building rust 1.89.0 for the various NetBSD targets. I am building on NetBSD/amd64, and cross-building on that platform for the other targets. So far I have successfully built the rust compiler natively (of course), but also for armv6, armv7, powerpc, sparc64 and aarch64. However, when trying to build for big-endian aarch64 -- the aarch64_be-unknown-netbsd target, this fails with

   Compiling petgraph v0.6.5
   Compiling process-wrap v8.2.1
   Compiling zip v4.0.0
error[E0463]: can't find crate for `serde`
  --> /usr/pkgsrc/wip/rust189/work/rustc-1.89.0-src/vendor/serde_json-1.0.140/src/de.rs:16:5
   |
16 | use serde::de::{self, Expected, Unexpected};
   |     ^^^^^ can't find crate

error[E0463]: can't find crate for `serde`
  --> /usr/pkgsrc/wip/rust189/work/rustc-1.89.0-src/vendor/serde_json-1.0.140/src/de.rs:17:5
   |
17 | use serde::forward_to_deserialize_any;
   |     ^^^^^ can't find crate

error[E0463]: can't find crate for `serde`

and it's all downhill from there.

This failure is experienced during this phase of the build:

Building tool rust-analyzer (stage1:x86_64-unknown-netbsd -> stage2:aarch64_be-unknown-netbsd)

which means that all the following phases (except the last one, of course, grep'ed from the build log) have successfully completed:

Building bootstrap
Building LLVM for aarch64_be-unknown-netbsd
Building LLVM for x86_64-unknown-netbsd
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-netbsd)
Building stage0 tool lld-wrapper (x86_64-unknown-netbsd)
Building LLD for x86_64-unknown-netbsd
Building stage0 tool wasm-component-ld (x86_64-unknown-netbsd)
Building tool llvm-bitcode-linker (stage0 -> stage1, x86_64-unknown-netbsd)
Building stage1 library artifacts (x86_64-unknown-netbsd -> aarch64_be-unknown-netbsd)
Building stage1 library artifacts (x86_64-unknown-netbsd)
Building compiler artifacts (stage1:x86_64-unknown-netbsd -> stage2:aarch64_be-unknown-netbsd)
Building stage1 tool lld-wrapper (x86_64-unknown-netbsd -> aarch64_be-unknown-netbsd)
Building LLD for aarch64_be-unknown-netbsd
Building stage1 tool wasm-component-ld (x86_64-unknown-netbsd -> aarch64_be-unknown-netbsd)
Building tool llvm-bitcode-linker (stage1:x86_64-unknown-netbsd -> stage2:aarch64_be-unknown-netbsd)
Building tool rustdoc_tool_binary (stage1:x86_64-unknown-netbsd -> stage2:aarch64_be-unknown-netbsd)
Building tool rust-analyzer-proc-macro-srv (stage1:x86_64-unknown-netbsd -> stage2:aarch64_be-unknown-netbsd)
Building stage0 tool generate-copyright (x86_64-unknown-netbsd)
Building stage0 tool rust-installer (x86_64-unknown-netbsd)
Dist rustc-1.89.0-aarch64_be-unknown-netbsd
Dist rust-std-1.89.0-aarch64_be-unknown-netbsd
Dist rustc-dev-1.89.0-aarch64_be-unknown-netbsd
Dist rust-analysis-1.89.0-aarch64_be-unknown-netbsd
Dist rust-src-1.89.0
Building tool cargo (stage1:x86_64-unknown-netbsd -> stage2:aarch64_be-unknown-netbsd)
Dist cargo-1.89.0-aarch64_be-unknown-netbsd
Building tool rust-analyzer (stage1:x86_64-unknown-netbsd -> stage2:aarch64_be-unknown-netbsd)
Build completed unsuccessfully in 1:55:16

I expected to see this happen: I expected the build to succeed, it certainly did for rust 1.88.0.

Instead, this happened: The build failed, as shown above.

I am a relative newbie to rust (yes, still...), and have a problem wrapping my head around why the choice of a particular target can have this effect, particularly when cross-building. It's all being built from the same tar-ball as distributed by the rust project.

Meta

Rust 1.89.0 as built natively is identified with:

rustc --version --verbose:

castor: {12} rustc --version --verbose
rustc 1.89.0 (29483883e 2025-08-04) (built from a source tarball)
binary: rustc
commit-hash: 29483883eed69d5fb4db01964cdf2af4d86e9cb2
commit-date: 2025-08-04
host: x86_64-unknown-netbsd
release: 1.89.0
LLVM version: 19.1.7
castor: {13}

However, the bootstrap build will use the upstream binary provided as part of rust 1.88.0.

Any hints pointing me in the direction of what might be going on here would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-AArch64Armv8-A or later processors in AArch64 modeO-netbsdOperating system: NetBSDT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions