Closed mlamoore closed 11 years ago
I found the problem (with some help from a friend). It stems from me not understanding gcc multi-lib properly; I thought it would select which library to use based on compiler flags, but it turns out you still need to direct it to the correct version of the library in the linker flags.
It's an error in the makefile that ships with libopencm3; because the makefile linked with -L to both arm-none-eabi/lib and arm-none-eabi/lib/thumb/cortex-m4/float-abi-hard/fpuv4-sp-d16 with the plain /lib first, it was using the libc.a from /lib instead of the floating-point specific subdirectory.
I'll look into how to push a fixed version to libopencm3.
I'm trying to build the stm32f4 usb_cdcacm example at https://github.com/libopencm3/libopencm3 using summon-arm-toolchain, but I'm getting a linker error when I use memcpy as it looks like gcc is trying to link to a libc.a library that doesn't have floating point support. I made a stripped down test.c to reproduce the issue as simply as possible:
test.c:
I grabbed the commands and arguments that make was using and ran gcc directly from the command line.
Compile (no errors):
Link:
Here's the errors I got:
If I try to remove -lopencm3_stm32f4 and -nostartfiles, I get a ridiculously long list of errors that make me think I'd need to dig into the linker script to figure them out.
Am I (or the libopencm3 Makefile) doing something wrong here? All of the other libopencm3 stm32f4 examples compiled, linked, and ran just fine, but they just use libopencm3 functions, no memcpy or other libc functions.