*** Floating Point Unavailable ***

Scott Howard scott@objsw.com
Wed Jun 30 12:48:00 GMT 1999

e.van.hoek@philips.com wrote:
> Hi,
>  I'm building a cross-compiler for powerpc-motorola-eabi.  When I execute my program the following exception occurs: *** Floating Point Unavailable ***.
> I think I can solve this problem by setting a bit in the MSR[FP] register. The most common place to do this seems to me the crt0 startup file. I'm using STARTUP(crt0.o); in my linkerfile. Doing this, ld returns the following error "multiple STARTUP
> files". Maybe someone can answer this questions:
> 1) Is writing a bit to the MSR[FP] register the solution to this problem or should I tackle this problem in another way?

Setting the FP bit will solve the problem.

> 2) Where can I find the file that gcc uses as default startup-file?

The startup file is crt0.S

> 3) How can I disable this default startup file?

You can't, at least not without a lot of compiler hacking. The best
approach is to add a line of assembly code in your main () function like

asm volatile (" li 3,0x2000; mtmsr 3" : : : "r3");

The best place to do this is in your application code rather than
crt0.S, since crt0.S should not have target-dependant code in it. ie: if
you made this change to crt0.S, then it would not work on
non-floating-point Power PCs such as the MPC860 family.

> 4) Should I use the sim-crt0.c startup-file that comes with gcc or the crt0.S file that comes with newlib?

I've had good luck with newlib's crt0.S. Make sure you are using newlib
1.8.1 however; version 1.8.0 does not properly initialize the bss/sbss
sections on startup.

New CrossGCC FAQ: http://www.objsw.com/CrossGCC
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

More information about the crossgcc mailing list