jsiei97/FunTechCortexMX_test — Issue #3: Link with ld and not gcc.
Author: jsiei97
Created: 2012-01-03 21:36:49+00:00
State: open

Thanks to Soeren Apel:

On http://fun-tech.se/stm32/OlimexBlinky/ld_float.php you mention a workaround for ld\'s inability to link the float library functions. It appears that this is caused by the need for multi-pass symbol resolving. The workaround you mention does work but it\'s unfortunately something I\'d consider a hack. A cleaner approach to solving the issue is to make ld repeatedly resolve the symbols of the object files and the required gcc library:

$(LD) $(LFLAGS) -o main.elf --start-group -lgcc main.o startup_stm32f10x.o --end-group

More or less change

LD = arm-none-eabi-gcc
$(LD) $(LFLAGS) -o main.elf main.o startup_stm32f10x.o

into

LD = arm-none-eabi-ld
$(LD) $(LFLAGS) -o main.elf --start-group -lgcc main.o startup_stm32f10x.o --end-group