If you simple try to compile the following test program:
Code: Select all
#include <algorithm>
int main() {}
and compile with something like:
Code: Select all
armv7m-hardfloat-eabi-g++ -std=c++11 -fsingle-precision-constant test.cpp -c
It even fails if I used a non cross-compiler (ie my amd64 system compiler). It is fine with -std=c++11, or -fsingle-precision-constant separately, but not combined. As far as I can tell, ChibiOS has always (for the extent that I have used it) had -fsingle-precision-constant defined in os/ports/GCC/ARMCMx/rules.mk. However, this seems to be the compiler switch combination that causes the error.
Like I said, my code is under version control. I can rule out that something recent broke it. My cross-compilers are also version controlled (via gentoo's crossdev), I have tried armv7m-hardfloat-eabi 4.7.3, 4.7.4, 4.8.4, 4.9.3, all with the same errors.
What could I be missing, I know this compiled before without any magic. If I remove the -fsingle-precision-constant from the specified rules.mk, it will compile, but I did not do that before. I also don't know what that changes in Chibi if I remove it. Any advice would be appreciated!