rust-cross / cargo-zigbuild

Compile Cargo project with zig as linker
MIT License
1.35k stars 50 forks source link

How to pass -fno-sanitize=undefined to `zig cc`? #223

Closed jiacai2050 closed 5 months ago

jiacai2050 commented 5 months ago

Since zig cc pass -fsanitize=undefined -fsanitize-trap=undefined by default, some project can be built successfully, but will throw error when running

$ ./target/debug/foo
Illegal instruction

https://github.com/rust-cross/cargo-zigbuild/blob/871605b68ba6074b24943ec9bdf2b32dea5590c0/src/zig.rs#L510

After some research, it seems there is no way to pass zig cc options?