Linking issues when building for cortex-m0
roel0 opened this issue · 1 comments
xargo 0.3.12
cargo 1.30.0-nightly (2fb77a49b 2018-09-07)
cortex-m-quickstart: 0.3.4
target: "thumbv6m-none-eabi"
Compiling for any target with thumbv7 seems to work fine
$ xargo build --example hello
.....
= note: rust-lld: error: undefined symbol: __clzsi2
>>> referenced by core.7aqqco4c-cgu.0
>>> core-4798f6087bcbc344.core.7aqqco4c-cgu.0.rcgu.o:(_$LT$char$u20$as$u20$core..fmt..Debug$GT$::fmt::h347e39ad26aec4d0) in archive /home/roel/.xargo/lib/rustlib/thumbv6m-none-eabi/lib/libcore-4798f6087bcbc344.rlib
I'm not sure if this is related to your issue, but Xargo hasn't been required for Cortex-M development for a while. Try installing a pre-compiled core library using Rustup instead:
$ rustup target add thumbv6m-none-eabi
And then you should be able to just build using Cargo:
$ cargo build --target thumbv6m-none-eabi