I am compiling code through Rust cargo
. I need to enable the llc
option --nozero-initialized-in-bss
to work around a bug in lld
.
I tried to pass the argument through
RUSTFLAGS="-C llvm-args=--nozero-initialized-in-bss" cargo build
but it did not work, generating the following error
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -C llvm-args=--nozero-initialized-in-bss --target thumbv7em-none-eabi --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 1)
--- stderr
rustc -Cllvm-args="..." with: Unknown command line argument '--nozero-initialized-in-bss'. Try: 'rustc -Cllvm-args="..." with --help'
rustc -Cllvm-args="..." with: Did you mean '--lower-interleaved-accesses'?
Is it because rustc
only recognizes a subset of all llc
options? Or my way of passing llc
options is incorrect?