Cross GCC3 for PPC (no fpu)

Dimi Shahbaz
Wed Jun 5 18:03:00 GMT 2002

A recap: I'm trying to write a clean script that build a complete crossgcc
toolchain (binutils, gcc3.0.4, and glibc2.2.5) from scratch.  See:

With help from Bill's FAQ and this list, I've gotten the PPC405
toolchain to build.  Executables generated by the toolchain failed to
run, however.  They returned an "Illegal Instruction" error message,
which gdb reported was due to a '__setfpucw' instruction being called.
This symbol was in libc.a.

I was passing --without-fp to glibc's configure, and "-mcpu=403" was in
CFLAGS, but it seems this symbol was still being built into glibc.  I
created the attached patch to fix the problem, by removing FPU object
files from math/Makefile, and disabling the code that used it in
sysdeps/unix/sysv/linux/init-first.c.  Using this, I successfully built
executables that correctly handled floating point emulation.

Has anyone else ran into this?  Is there a better way to disable the FPU
objects/calls from the build?

Also, is there an #ifdef I can use to disable the FPU code in
init-first.c?  Right now I'm using #if 0, which is not that elegant.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: glibc-ppc-nofpu.patch2
URL: <>
-------------- next part --------------
Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list