rust-embedded / cortex-m-quickstart

Template to develop bare metal applications for Cortex-M microcontrollers
791 stars 164 forks source link

Linking issues when building for cortex-m0 #48

Closed roel0 closed 6 years ago

roel0 commented 6 years ago

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

hannobraun commented 6 years ago

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