From 73f5cc78d20ca0f8de2cca2cd9c2a64ddf5b103b Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Sat, 20 Feb 2021 12:40:04 +0100 Subject: [PATCH] Kbuild: use panic=unwind for proc macros Avoids the https://github.com/rust-lang/rust/issues/82320 rustc crash. Signed-off-by: Miguel Ojeda --- rust/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/Makefile b/rust/Makefile index 496c55cf130554..5726bc10e5ac43 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -62,9 +62,12 @@ $(objtree)/rust/exports_kernel_generated.h: exports_target_type := _RUST_GPL $(objtree)/rust/exports_kernel_generated.h: $(objtree)/rust/kernel.o FORCE $(call if_changed,exports) +# `-Cpanic=unwind -Cforce-unwind-tables=y` overrides `rustc_flags` in order to +# avoid the https://github.com/rust-lang/rust/issues/82320 rustc crash. quiet_cmd_rustc_procmacro = RUSTC P $@ cmd_rustc_procmacro = \ $(RUSTC) $(rustc_flags) --emit=dep-info,link --extern proc_macro \ + -Cpanic=unwind -Cforce-unwind-tables=y \ --crate-type proc-macro --out-dir $(objtree)/rust/ \ --crate-name $(patsubst lib%.so,%,$(notdir $@)) $<; \ mv $(objtree)/rust/$(patsubst lib%.so,%,$(notdir $@)).d $(depfile); \