While compiling rust code with cargo with below command:
cargo build --release --target=armv7a-none-eabi
cp target/armv7a-none-eabi/release/librustdev.a ./..
By default, rust compiler is adding some linker flags (-Wl,-Bstatic -lrustdev -Wl,-Bdynamic) those are not supported(recognized) by armlink linker and giving below error while building:
Fatal error: L3900U: Unrecognized option '-Wl,-Bstatic'
We also tried to emit the object files and used the armar to build the library, to pass it to armlink still we are seeing the same error, so we are suspecting these flags are added during compilation time only.
we also tried to suppress the linker flags with the below command:
export RUSTFLAGS="-C link-self-contained=no -C link-arg=-nostartfiles -C link-arg=-nodefaultlibs -C link-arg=-Wl,-Bstatic -C link-arg=-Wl,-Bdynamic"
but it did not work, still same error as above.
Can anyone suggest how we can remove(suppress) those linker flags added by rust compiler.