By default, if Rust is passed `--target=foo` rather than a target.json file, it will infer a default sysroot if that component is installed. As the proposed aarch64 support [1] uses `aarch64-unknown-none` rather than a target.json file, this is needed [2] to prevent rustc from being confused between the custom kernel sysroot and the pre-installed one. [ Miguel: Applied Boqun's extra case (for `rusttest`) and reworded to add links to the arm64 patch series discussion. In addition, fixed the `rustdoc` target too (which requires a conditional since `cmd_rustdoc` is also used for host crates like `macros`). ]
Showing the changes to scripts (1 of 2 files). Show all
Unified · Split
| @@ -275,6 +275,7 @@ rust_common_cmd = \ · 274 unmodified lines | ||
| 275 | 275 | --extern alloc --extern kernel \ |
| 276 | 276 | --crate-type rlib -L $(objtree)/rust/ \ |
| 277 | 277 | --crate-name $(basename $(notdir $@)) \ |
| 278 | + --sysroot=/dev/null \ | |
| 278 | 279 | --out-dir $(dir $@) --emit=dep-info=$(depfile) |
| 279 | 280 | |
| 280 | 281 | # `--emit=obj`, `--emit=asm` and `--emit=llvm-ir` imply a single codegen unit |