History

rust: Suppress searching builtin sysroot

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`). ]

Matthew Maurer committed 3 years ago

Commit 71479ee1 parent 88c2e112 files · +4 −0Browse files

Showing the changes to scripts (1 of 2 files). Show all

Unified · Split

scripts/Makefile.build+1−0
@@ -275,6 +275,7 @@ rust_common_cmd = \ · 274 unmodified lines
275275 --extern alloc --extern kernel \
276276 --crate-type rlib -L $(objtree)/rust/ \
277277 --crate-name $(basename $(notdir $@)) \
278+ --sysroot=/dev/null \
278279 --out-dir $(dir $@) --emit=dep-info=$(depfile)
279280
280281 # `--emit=obj`, `--emit=asm` and `--emit=llvm-ir` imply a single codegen unit