printf always prints "nan" for double variables on MIPS

David Daney ddaney at avtrex.com
Mon Feb 26 04:32:16 UTC 2007


Kevin Nicoll wrote:
> I've been using the soft-float toolchain as a workaround for some time
> now, and will continue to do so if necessary.  I just want to be
> certain that this is the correct solution, and if this is a bug, that
> anyone it might affect will know about it.
>
> Is it your opinion that this is an FPU emulator issue and not a uClibc
> issue, then?
>   
Not necessarily.  I have used a glibc toolchain configured for 
hard-float on a CPU with no FPU (pnx8550) with no problems.

What you cannot do is mix hard and soft float code.  If your C library 
is configured for soft-float, you cannot link it to an executable 
compiled as hard-float.  The ABI is different for the two.  The 
hard-float ABI passes the first two floating point parameters in FPU 
registers. The soft-float ABI passes floating point parameters as if 
they were either 32 or 64 bit integers.  If you mix and match, the 
floating point parameters will not be passed correctly.

David Daney




More information about the uClibc mailing list