This is the mail archive of the
mailing list for the GCC project.
Re: How to completely disable floating-point support
"R. Diez" <email@example.com> writes:
> I am building a GCC 4.5.3 cross-compiler for an embedded PowerPC target, together with binutils-2.21 and newlib 1.19.0, and I wish to completely disable floating-point support.
> If I inadvertently try to use some floating-point feature, I wish to get some compilation or link error. At the moment, with GCC/newlib, the compiler seems to use the software emulation without warning, making the resulting binary bigger and slower. It is often the case that I could replace those floating-point calculations with integer alternatives, only if I knew where they all are.
> Apparently, newlib does not have the capability to drop floating-point functions like atof from the library, but I wonder if that would work at all, or it GCC would then fail to build when those routines are missing from the C runtime library.
gcc doesn't care what is in newlib; only your program cares.
In this case if you look at your libgcc.a file you will see several
functions with names like __adddf3. Remove all the functions whose
names end in sfN or dfN. That should give you an error at link time for
any code which uses floating point.
You will have to do this manually. gcc does not have a mode which
entirely prevents floating point operations, as very few users have any
interest in that.