From ad1a7438979b816506ec35bceb407b335c8d2509 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Fri, 2 Jul 2021 15:37:18 +0200 Subject: [PATCH 1/3] Makefile: mrproper: clean some more `rust/` generated files Signed-off-by: Miguel Ojeda --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f5b496948cb92b..d525d531e065d7 100644 --- a/Makefile +++ b/Makefile @@ -1610,7 +1610,8 @@ MRPROPER_FILES += include/config include/generated \ certs/signing_key.pem certs/signing_key.x509 \ certs/x509.genkey \ vmlinux-gdb.py \ - *.spec + *.spec \ + rust/*_generated.h rust/*_generated.rs rust/libmacros.so # clean - Delete most, but leave enough to build external modules # From 0627f1a5a36051235877d699d6eb30f1d8715356 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Fri, 2 Jul 2021 16:18:24 +0200 Subject: [PATCH 2/3] Makefile: directly export `RUSTC_BOOTSTRAP=1` Suggested-by: bjorn3 Signed-off-by: Miguel Ojeda --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d525d531e065d7..8ab454529f064c 100644 --- a/Makefile +++ b/Makefile @@ -460,7 +460,6 @@ READELF = $(CROSS_COMPILE)readelf STRIP = $(CROSS_COMPILE)strip endif RUSTC = rustc -RUSTC_BOOTSTRAP = 1 RUSTDOC = rustdoc RUSTFMT = rustfmt CLIPPY_DRIVER = clippy-driver @@ -550,8 +549,10 @@ ifdef RUST_LIB_SRC export RUST_LIB_SRC endif +export RUSTC_BOOTSTRAP := 1 + export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC -export RUSTC RUSTC_BOOTSTRAP RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN CARGO +export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN CARGO export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD From f8f3aa1ade8b53aaba8b270a06639b01cb319953 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Fri, 2 Jul 2021 16:19:49 +0200 Subject: [PATCH 3/3] Makefile: restrict Rust unstable features for kernel modules Suggested-by: bjorn3 Signed-off-by: Miguel Ojeda --- scripts/Makefile.build | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 7a9d5d090d7313..b9791ee5896964 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -300,6 +300,7 @@ quiet_cmd_rustc_o_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@ cmd_rustc_o_rs = \ RUST_MODFILE=$(modfile) \ $(RUSTC_OR_CLIPPY) $(rustc_flags) $(rustc_cross_flags) \ + -Zallow-features=allocator_api,bench_black_box,concat_idents,global_asm,try_reserve \ --extern alloc --extern kernel \ --crate-type rlib --out-dir $(obj) -L $(objtree)/rust/ \ --crate-name $(patsubst %.o,%,$(notdir $@)) $<; \