Minimal Rust Kernel: Only mention core in error message

The `OR` is confusing since the reader might think that it's part of the output. Also, the compiler_builtins error should no longer occur now that the library lives on crates.io.
This commit is contained in:
Philipp Oppermann
2019-07-09 19:26:24 +02:00
parent c4ccf7303a
commit f8afce46a1

View File

@@ -240,14 +240,12 @@ We can now build the kernel for our new target by passing the name of the JSON f
``` ```
> cargo build --target x86_64-blog_os.json > cargo build --target x86_64-blog_os.json
error[E0463]: can't find crate for `core` OR error[E0463]: can't find crate for `core`
error[E0463]: can't find crate for `compiler_builtins`
``` ```
It fails! The error tells us that the Rust compiler no longer finds the `core` or the `compiler_builtins` library. Both libraries are implicitly linked to all `no_std` crates. The [`core` library] contains basic Rust types such as `Result`, `Option`, and iterators, whereas the [`compiler_builtins` library] provides various lower level functions expected by LLVM, such as `memcpy`. It fails! The error tells us that the Rust compiler no longer finds the [`core` library]. This library contains basic Rust types such as `Result`, `Option`, and iterators, and is implicitly linked to all `no_std` crates.
[`core` library]: https://doc.rust-lang.org/nightly/core/index.html [`core` library]: https://doc.rust-lang.org/nightly/core/index.html
[`compiler_builtins` library]: https://github.com/rust-lang-nursery/compiler-builtins
The problem is that the core library is distributed together with the Rust compiler as a _precompiled_ library. So it is only valid for supported host triples (e.g., `x86_64-unknown-linux-gnu`) but not for our custom target. If we want to compile code for other targets, we need to recompile `core` for these targets first. The problem is that the core library is distributed together with the Rust compiler as a _precompiled_ library. So it is only valid for supported host triples (e.g., `x86_64-unknown-linux-gnu`) but not for our custom target. If we want to compile code for other targets, we need to recompile `core` for these targets first.