Currently, a ccache enabled build (i.e. HOSTCC="ccache $compiler") fails with:
| HOSTRUSTC scripts/generate_rust_target
| HOSTCC scripts/kallsyms
| HOSTCC scripts/sorttable
| HOSTCC scripts/asn1_compiler
| TOUCH include/generated/gcc-plugins.h
| DESCEND objtool
| error: multiple input filenames provided (first two filenames are gcc and
.../scripts/generate_rust_target.rs)
This is caused by this line: https://github.com/Rust-for-Linux/linux/blob/b8d687c7eeb52d0353ac27c4f71594a2e6aa365f/scripts/Makefile.host :
# `--out-dir` is required to avoid temporaries being created by `rustc` in the
# current working directory, which may be not accessible in the out-of-tree
# modules case.
hostrust_flags = --out-dir $(dir $@) --emit=dep-info=$(depfile) \
-Clinker-flavor=gcc -Clinker=$(HOSTCC) \
-Clink-args='$(call escsq,$(KBUILD_HOSTLDFLAGS))' \
$(KBUILD_HOSTRUSTFLAGS) $(HOST_EXTRARUSTFLAGS) \
$(HOSTRUSTFLAGS_$(target-stem))
Surely, -Clinker=$(HOSTCC) should be escaped to to -Clinker="$(HOSTCC)" but that does not fix the problem because rustc interpret the -Clinker option as a path and not a command.
Notes:
Cc: @alban-moizan-smile
Currently, a ccache enabled build (i.e.
HOSTCC="ccache $compiler") fails with:This is caused by this line: https://github.com/Rust-for-Linux/linux/blob/b8d687c7eeb52d0353ac27c4f71594a2e6aa365f/scripts/Makefile.host :
Surely,
-Clinker=$(HOSTCC)should be escaped to to-Clinker="$(HOSTCC)"but that does not fix the problem becauserustcinterpret the-Clinkeroption as a path and not a command.Notes:
Cc: @alban-moizan-smile