This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cross GCC3 for PPC (no fpu)


Hi,
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:

     http://www.dimator.org/~dimator/work/crossgcc/

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.

Thanks
-Dimi


--- sysdeps/unix/sysv/linux/init-first.c.orig	Wed Jun  5 14:39:12 2002
+++ sysdeps/unix/sysv/linux/init-first.c	Wed Jun  5 14:39:15 2002
@@ -77,10 +77,12 @@
       /* Set the FPU control word to the proper default value if the
 	 kernel would use a different value.  (In a static program we
 	 don't have this information.)  */
+#if 0
 #ifdef SHARED
       if (__fpu_control != _dl_fpu_control)
 #endif
 	__setfpucw (__fpu_control);
+#endif
     }
 
   /* Save the command-line arguments.  */
--- math/Makefile.orig	Wed Jun  5 15:47:37 2002
+++ math/Makefile	Wed Jun  5 15:47:47 2002
@@ -29,7 +29,7 @@
 distribute	:= math_ldbl.h math_private.h machine/asm.h
 
 # FPU support code.
-aux		:= setfpucw fpu_control
+#aux		:= setfpucw fpu_control
 
 # Build the -lm library.
 


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]