ARM compilation error, VFP registers used by executable, not object file
I have found on an arm hardfloat system where glibc binutils and gcc were crosscompiled, using gcc gives the same error.
It is solved by exporting-mfloat-abi=hard
to flags, then gcc compiles without errors.
Your target triplet indicates that your compiler is configured for the hard-float ABI. This means that the libgcc library will also be hardfp. The error message indicates that at least part of your system is using soft-float ABI.
If the compiler has multilib enabled (you can tell with -print-multi-lib
) then you can use -mfloat-abi=softfp
, but if not then that option won't help you much: gcc will happily generate softfp code, but then there'll be no compatible libgcc to link against.
Basically, hardfp and softfp are just not compatible. You need to get your whole system configured one way or the other.
EDIT: some distros are, or will be, "multiarch". If you have one of those then it's possible to install both ABIs at once, but that's done by doubling everything up -- the compatibility issues still exist.