Skip to content

error: Error loading target specification: Could not find specification for target "avr-atmega328p" #133

Open
@1inguini

Description

@1inguini

the shell I am using is fish, version 3.0.1, the directory I installed avr-rust is $HOME/.avr-rust/.
versions of rustup and xargo are:

➤ rustup -V
rustup 1.16.0
➤ xargo -V
xargo 0.3.13
cargo 1.34.0-nightly (b33ce7fc9 2019-02-19)

I tried to build blink, only to get this error.

➤ env XARGO_RUST_SRC=$HOME/Desktop/rust/rust-avr/src/ env RUST_TARGET_PATH=`pwd` env RUST_BACKTRACE=1 rustup run avr-toolchain xargo build --target avr-atmega328p --release
warning: Patch `rustc-std-workspace-core v1.0.0 (/home/linguini/Desktop/rust/rust-avr/src/tools/rustc-std-workspace-core)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --sysroot /home/linguini/.xargo -Z force-unstable-if-unmarked --target avr-atmega328p --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 1)
--- stderr
error: Error loading target specification: Could not find specification for target "avr-atmega328p"
  |
  = help: Use `--print target-list` for a list of built-in targets


error: `"cargo" "build" "--release" "--manifest-path" "/tmp/xargo.XYqLK3pXSFys/Cargo.toml" "--target" "avr-atmega328p" "-p" "core"` failed with exit code: Some(101)
stack backtrace:
   0: error_chain::make_backtrace::h90af62d5c4a6fbd6 (0x563660f6f16b)
   1: <error_chain::State as core::default::Default>::default::h23f817a122243ac9 (0x563660f6f235)
   2: <std::process::Command as xargo::extensions::CommandExt>::run::h01346a6b4f35f543 (0x563660f22d4b)
   3: xargo::sysroot::build::h240260972f2e09ed (0x563660f2a541)
   4: xargo::sysroot::update::h94fd82f52808b493 (0x563660f2e65d)
   5: xargo::main::ha282b52dabbcaa07 (0x563660f1bc7a)
   6: std::rt::lang_start::{{closure}}::h6c099b348d99c7de (0x563660f1f8f2)
   7: std::rt::lang_start_internal::{{closure}}::h53f6e74893a27d59 (0x563660f9a162)
             at src/libstd/rt.rs:59
      std::panicking::try::do_call::h8945e3e0fe63365a
             at src/libstd/panicking.rs:307
   8: __rust_maybe_catch_panic (0x563660fa71a9)
             at src/libpanic_unwind/lib.rs:102
   9: std::panicking::try::hee49dda4da841cb1 (0x563660f9a058)
             at src/libstd/panicking.rs:286
  10: std::panic::catch_unwind::h89d0b17e1bb724c9 (0x563660f8d665)
             at src/libstd/panic.rs:398
      std::rt::lang_start_internal::hcbec2a0475a1169a
             at src/libstd/rt.rs:58
  11: main (0x563660f1ca61)
  12: __libc_start_main (0x7f6918011222)
  13: _start (0x563660f0c1ad)
  14: <unknown> (0x0)

When I use cargo xbuild instead of xargo build, the error changes to this:

➤ env XARGO_RUST_SRC=$HOME/Desktop/rust/rust-avr/src/ env RUST_TARGET_PATH=`pwd` env RUST_BACKTRACE=1 rustup run avr-toolchain cargo xbuild --target avr-atmega328p.json --release
    Updating crates.io index
   Compiling core v0.0.0 (/home/linguini/Desktop/rust/rust-avr/src/libcore)
   Compiling compiler_builtins v0.1.5
Expected either Y or Z register
UNREACHABLE executed at /home/linguini/Desktop/rust/rust-avr/src/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp:146!
error: Could not compile `core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name core /home/linguini/Desktop/rust/rust-avr/src/libcore/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=afd9ec364b288331 -C extra-filename=-afd9ec364b288331 --out-dir /tmp/xargo.8r2MfIHK0mSX/target/avr-atmega328p/release/deps --target /home/linguini/Desktop/rust/atmega328p-blink/avr-atmega328p.json -L dependency=/tmp/xargo.8r2MfIHK0mSX/target/avr-atmega328p/release/deps -L dependency=/tmp/xargo.8r2MfIHK0mSX/target/release/deps` (signal: 6, SIGABRT: process abort signal)
error: `"cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/xargo.8r2MfIHK0mSX/Cargo.toml" "--target" "avr-atmega328p.json" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
stack backtrace:
   0: error_chain::make_backtrace::h90af62d5c4a6fbd6 (0x55b7585c414b)
   1: <error_chain::State as core::default::Default>::default::h23f817a122243ac9 (0x55b7585c4215)
   2: <std::process::Command as xargo_lib::extensions::CommandExt>::run::ha0480dbe4aad3708 (0x55b75858d482)
   3: xargo_lib::sysroot::update::hfb93c0d6a6a0415d (0x55b758584187)
   4: xargo_lib::main_common::h62f84698270e01b4 (0x55b75856d212)
   5: std::rt::lang_start::{{closure}}::h393358cd92796d6b (0x55b75856a2d2)
   6: std::rt::lang_start_internal::{{closure}}::h53f6e74893a27d59 (0x55b7586266c2)
             at src/libstd/rt.rs:59
      std::panicking::try::do_call::h8945e3e0fe63365a
             at src/libstd/panicking.rs:307
   7: __rust_maybe_catch_panic (0x55b758633719)
             at src/libpanic_unwind/lib.rs:102
   8: std::panicking::try::hee49dda4da841cb1 (0x55b7586265b8)
             at src/libstd/panicking.rs:286
   9: std::panic::catch_unwind::h89d0b17e1bb724c9 (0x55b758617ec5)
             at src/libstd/panic.rs:398
      std::rt::lang_start_internal::hcbec2a0475a1169a
             at src/libstd/rt.rs:58
  10: main (0x55b75856a2c1)
  11: __libc_start_main (0x7f32bf084222)
  12: _start (0x55b75856a1ad)
  13: <unknown> (0x0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions