Description
Let's assume a target with no unwinding support (e.g. a small system on a chip). RFC 1513 added a -C panic=strategy
flag and a cargo profile option for disabling the unwinding machinery. However, even with those options, we still need dummy implementations for eh_personality
and _Unwind_Resume
.
The reason is that the cross-compiled sysroot (e.g. via xargo) still contains references to those functions. We can avoid this by setting RUSTFLAGS
to -C panic=abort
when invoking xargo
. This way, the sysroot is created without unwinding. This solution works, but feels a bit hacky.
We could solve this problem in an easier way if we added a option for panic=abort
in the target json. Then we could express targets without unwinding support and xargo would automatically compile the sysroot correctly.