-
-
Notifications
You must be signed in to change notification settings - Fork 84
Description
The following command successfully compiles the result:
RUSTFLAGS='-C target-feature=+crt-static' cargo zigbuild --release --target aarch64-apple-darwin
However, at runtime, a panic in the program causes the process to exit. error: fatal runtime error: failed to initiate panic, error 5
If I compile directly on macOS without using zigbuild, it runs normally and a panic does not cause the process to exit:
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target aarch64-apple-darwin
Why does the same code exhibit different panic behavior when compiled with cargo build versus cargo zigbuild?
The same issue occurs with x86_64-apple-darwin, where a panic causes the process to terminate:
RUSTFLAGS='-C target-feature=+crt-static' cargo zigbuild --release --target x86_64-apple-darwin
However, x86_64-pc-windows-gnu does not have this problem.
Thanks!