Missing stack-unwind info in UEFI target

In short, the .pdata section in the efi file does not contain unwind info for functions written in Rust. In this regard I can't properly unwind the stack. But if I switch to *-windows-msvc target, the unwind info will appear in .pdata section and thus stack trace can be shown properly.
Is there a special switch to let compiler generate stack-trace info for UEFI targets? Or do I have to use *-windows-msvc target in order to build my efi application?

my guess is because the uefi target use panic=abort.

to my knowledge, the uefi target and windows target are ABI incompatible, so it's probably a bad idea.

I don't know if it would work, but you can try to dump the uefi spec and patch it to enable unwind table, then use the patched spec as a custom target. you'll need a nightly toolchain for this though. I guess the requires-uwtable option is what you should look at.

EDIT:

the custom target approach maybe interesting, but I just found this force-unwind-tables code gen option, which seems to be better answer.

Just tried and it turned out great. The .pdata section now contains Rust functions.
Add a .cargo/config.toml file and add a section:

[build]
rustflags = ["-Cforce-unwind-tables"]