rtic: rtfm based stm32f030 debug build causes relcation truncated error
here is an example project: https://gitlab.com/xnor/stm32f0308-disco-rust
If I build it without --release I get
target/thumbv6m-none-eabi/debug /deps/libstm32f030-5466fdead1a18a6d.rlib(stm32f030-5466fdead1a18a6d.0.o): In function `WWDG':
stm32f030.cgu-0.rs:(.text+0x0): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol `DEFAULT_HANDLER' defined in .text.DEFAULT_HANDLER section in /home/alex/projects/modular/threshpan/target/thumbv6m-none-eabi/debug/deps/libcortex_m_rt-881d17200def560b.rlib(cortex_m_rt-881d17200def560b.0.o)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 41 (4 by maintainers)
Commits related to this issue
- Use far-ranged jumps for DH_TRAMPOLINE Fixes japaric/cortex-m-rtfm#42 Note that this will make all generated crates that target an armv6 device fail to compile unless they add a build script enablin... — committed to therealprof/svd2rust by jonas-schievink 7 years ago
- [WIP] safe creation of `&'static mut` references This implements the "rooting" mechanism proposed in #47. However, it implements a `root` constructor function instead of list of `roots` values as ori... — committed to rtic-rs/rtic by japaric 7 years ago
- Merge pull request #42 from AfoHT/replacetravis Replace Travis with Github Actions — committed to rtic-rs/rtic by korken89 4 years ago
@Samonitari Yes, thumb1 has
binstrunction, but we needb.wwhich is 32bit T2 instruction. There is no way to encode such instruction on Cortex-M0. So there is no bug in LLVM.@japaric I figured out what the problem is…
svd2rustSeemingly the default CPU model for the armv6-m architecture is broken. I tried various options including using the -mcpu=cortex-m0 and -mcpu=cortex-m3 options on the generated assembly and the latter automatically changes branches where the target doesn’t fit into the available 2 bytes into the 4 bytes form of the branch while the default model and -mcpu=cortex-m0 (which actually might be the default model) keeps it as-is causing the linker to barf.
However, if I explicitly change the short branch in the code emitted by
svd2rustinto the long form, it’ll happily compile and link the binaries, cf.:@x37v Can you with the above change on your code?