Skip to content

error: linking with rust-lld failed: exit status: 1 #9989

@Hankappa

Description

@Hankappa

Problem

Hi I following the https://lowenware.com/blog/osdev/aarch64-bare-metal-program-in-rust/
try to test aarch64 bare-metal under QEMU.
Seems meet error and I can't find how to solution.
(I've try a lot way from google search....)

~/.cargo/bin/aarch64-bare-metal$ rustup target add aarch64-unknown-none
info: component 'rust-std' for target 'aarch64-unknown-none' is up to date
~/.cargo/bin/aarch64-bare-metal$ cargo -v xbuild --target=aarch64-unknown-none.json
error: failed to run rustc to learn about target-specific information

Caused by:
process didn't exit successfully: rustc - --crate-name ___ --print=file-names -Cembed-bitcode=yes --target /home/hank/.cargo/bin/aarch64-bare-metal/aarch64-unknown-none.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg (exit status: 1)
--- stderr
error: Error loading target specification: may not set is_builtin for targets not built-in. Run rustc --print target-list for a list of built-in targets

error: "/home/hank/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/cargo-xbuildsuBC5o/Cargo.toml" "--target" "aarch64-unknown-none.json" "--" "-Z" "force-unstable-if-unmarked" failed with exit code: Some(101)

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

~/.cargo/bin/aarch64-bare-metal$ cargo version --verbose
cargo 1.57.0-nightly (c7957a74b 2021-10-11)
release: 1.57.0
commit-hash: c7957a74bdcf3b11e7154c1a9401735f23ebd484
commit-date: 2021-10-11
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:OpenSSL/1.1.1l)
os: Ubuntu 18.04 (bionic) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions