问题
If I specify panic
like this, it works for all targets:
[profile.release]
panic = "abort"
I want to specify panic = "abort"
only for target=arm-linux-androideabi
.
回答1:
You will need to add a .cargo/config to your project and use it to specify the panic settings instead of Cargo.toml:
[target.arm-linux-androideabi]
rustflags = ["-C", "panic=abort"]
The two main configuration headings you will want to look at are [target.$triple]
and [target.'cfg(...)']
.
来源:https://stackoverflow.com/questions/47663961/is-it-possible-to-specify-panic-abort-for-a-specific-target