Skip to content

Compilation error: can't find crate for std; the x86_64-linux-kernel target may not be installed #27

Closed
@wecing

Description

@wecing

Compiling the current head of the rust branch failed for me. Here is my setup:

> rustup toolchain install nightly-2020-08-27
> rustup default nightly-2020-08-27
> rustup component add rust-src
> cat .config | grep -E '(RUST|CARGO)'
CONFIG_HAS_RUST=y
CONFIG_RUSTC_VERSION=14700
CONFIG_CARGO_VERSION=14700
CONFIG_RUST_EXAMPLE=y
CONFIG_RANDOM_TRUST_CPU=y
# CONFIG_RANDOM_TRUST_BOOTLOADER is not set
# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS=""
# CONFIG_SECONDARY_TRUSTED_KEYRING is not set
> make LLVM=1
  ...
  CARGO     arch/x86/entry/vdso/out/libvdso-image.a
   Compiling core v0.0.0 (/home/$USER/.rustup/toolchains/nightly-2020-08-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling kernel v0.1.0 (/home/$USER/Code/rust-for-linux/rust/kernel)
   Compiling rustc-std-workspace-core v1.99.0 (/home/$USER/.rustup/toolchains/nightly-2020-08-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling compiler_builtins v0.1.32
   Compiling alloc v0.0.0 (/home/$USER/.rustup/toolchains/nightly-2020-08-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
   Compiling bitflags v1.2.1
   Compiling shlex v0.1.1 (/home/$USER/Code/rust-for-linux/rust/shlex)
error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-linux-kernel` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `shlex`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
make[3]: *** [scripts/Makefile.build:318: arch/x86/entry/vdso/out/libvdso-image.a] Error 101
make[2]: *** [scripts/Makefile.build:518: arch/x86/entry/vdso] Error 2
make[1]: *** [scripts/Makefile.build:518: arch/x86/entry] Error 2
make: *** [Makefile:1838: arch/x86] Error 2

Is there something missing in Documentation/rust/quick-start.rst?

Metadata

Metadata

Assignees

No one assigned

    Labels

    • docsRelated to `Documentation/rust/`, `samples/`, generated docs, doctests, typos...

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions