You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
error: unable to run rust-objcopy: Bad CPU type in executable (os error 86) #145699
C-bugCategory: This is a bug.O-appleOperating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS)O-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Compile with error: error: unable to run rust-objcopy: Bad CPU type in executable (os error 86)
full output:
error: unable to run `rust-objcopy`: Bad CPU type in executable (os error 86)
error: could not compile `proc-macro2` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `libc` (build script) due to 1 previous error
This is a problem on all tier 2 targets. The rust-objcopy executable is linked and compiled for the host that compiled it rather than the target. See also #143415 (comment)
I'll also cc @shepmaster in case it's related to demoting the target, but without the bisection it could be any other CI change on the builder or a bootstrap issue, so I'll also cc @Kobzol.
BTW, a possible temporary workaround would be setting strip = false in your Cargo.toml, that should remove the need to run rust-objcopy in the first place.
If you bisect this specific issue of rust-objcopy being aarch64 instead of x86_64, I'd expect it to come back to the demotion PR. However, if this is occurring for any cross-compilation (as mentioned above), then you'd have to bisect any (every?) cross-compiled toolchain for a rust-objcopy binary being the wrong architecture.
For example, this shows rustc-objcopy is x86_64 when it should be aarch64 for the aarch64-unknown-linux-musl target:
cd $HOME/.rustup/toolchains/nightly-aarch64-unknown-linux-musl/lib/rustlib/*/bin ; file *
gcc-ld: directory
rust-lld: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, with debug_info, not stripped
rust-objcopy: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=486eb10c870e12cbb52f742c3322a19cc027b776, for GNU/Linux 3.2.0, not stripped
wasm-component-ld: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, stripped
Yes, as stated above, this will look like it occurred due to the Tier 2 demotion in the last few days, but the root problem predates this as it affects cross compiled builds in general.
C-bugCategory: This is a bug.O-appleOperating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS)O-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Activity
Wyvern commentedon Aug 21, 2025
on x86_64-apple-darwin host run:
looks like
rust-objcopycompiled to tier1 arm64 apple target rather than host x86_64.The problem maybe related to demote
x86_64-apple-darwinto tier2.Gelbpunkt commentedon Aug 21, 2025
This is a problem on all tier 2 targets. The rust-objcopy executable is linked and compiled for the host that compiled it rather than the target. See also #143415 (comment)
Wyvern commentedon Aug 21, 2025
interesting, only objcopy got a wrong target compiling.
benalleng commentedon Aug 21, 2025
I can confirm I see the same problem only with rust-objcopy.
lqd commentedon Aug 21, 2025
Could anyone bisect this issue with https://github.com/rust-lang/cargo-bisect-rustc/?
I'll also cc @shepmaster in case it's related to demoting the target, but without the bisection it could be any other CI change on the builder or a bootstrap issue, so I'll also cc @Kobzol.
BTW, a possible temporary workaround would be setting
strip = falsein your Cargo.toml, that should remove the need to runrust-objcopyin the first place.shepmaster commentedon Aug 22, 2025
If you bisect this specific issue of
rust-objcopybeing aarch64 instead of x86_64, I'd expect it to come back to the demotion PR. However, if this is occurring for any cross-compilation (as mentioned above), then you'd have to bisect any (every?) cross-compiled toolchain for arust-objcopybinary being the wrong architecture.For example, this shows
rustc-objcopyis x86_64 when it should be aarch64 for theaarch64-unknown-linux-musltarget:thaliaarchi commentedon Aug 22, 2025
The regression appears to have happened yesterday:
shepmaster commentedon Aug 22, 2025
Yes, as stated above, this will look like it occurred due to the Tier 2 demotion in the last few days, but the root problem predates this as it affects cross compiled builds in general.
Rollup merge of rust-lang#145763 - Kobzol:llvm-bindir-cross, r=Mark-S…
Unrolled build for #145763
Rollup merge of #145763 - Kobzol:llvm-bindir-cross, r=Mark-Simulacrum
Rollup merge of #145763 - Kobzol:llvm-bindir-cross, r=Mark-Simulacrum