jsiei97 / FunTechCortexMX_test

A test suite to verify that the fun tech gcc is woking.
http://fun-tech.se/stm32/
4 stars 3 forks source link

Link with ld and not gcc. #3

Open jsiei97 opened 12 years ago

jsiei97 commented 12 years ago

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