Skip to content

Commit 9ba918a

Browse files
authored
Merge pull request #91 from Rust-for-Linux/rust-proc-macro-unwind
Kbuild: use panic=unwind for proc macros
2 parents 03777f6 + 73f5cc7 commit 9ba918a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rust/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ $(objtree)/rust/exports_kernel_generated.h: exports_target_type := _RUST_GPL
6262
$(objtree)/rust/exports_kernel_generated.h: $(objtree)/rust/kernel.o FORCE
6363
$(call if_changed,exports)
6464

65+
# `-Cpanic=unwind -Cforce-unwind-tables=y` overrides `rustc_flags` in order to
66+
# avoid the https://github.com/rust-lang/rust/issues/82320 rustc crash.
6567
quiet_cmd_rustc_procmacro = RUSTC P $@
6668
cmd_rustc_procmacro = \
6769
$(RUSTC) $(rustc_flags) --emit=dep-info,link --extern proc_macro \
70+
-Cpanic=unwind -Cforce-unwind-tables=y \
6871
--crate-type proc-macro --out-dir $(objtree)/rust/ \
6972
--crate-name $(patsubst lib%.so,%,$(notdir $@)) $<; \
7073
mv $(objtree)/rust/$(patsubst lib%.so,%,$(notdir $@)).d $(depfile); \

0 commit comments

Comments
 (0)