If I compile GCC project for Cortex-M4 (LPC4357) and use -mcpu=cortex-m4 switch floats aren't working (calls blx __addsf3, which eventually branches to stmia command, which results in an error interrupt, probably due to bad values in registers). If I compile with -mcpu=cortex-m3 it calls bl __addsf3, which has a different source and works.
I think I might have to fix other switches in order to make floats work with -mcpu=cortex-m4... I tried several things, but this is really strange.
Relevant compiler and linker switches:
Compiler: -mthumb -mcpu=cortex-m4 -std=c99 -c -g -D DEBUG -D gcc
Linker: -nostartfiles -nostdlib -nodefaultlibs -fno-exceptions -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -lgcc -lc
Can you tell if I'm missing something obvious here?