bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cross GCC3 for PPC (no fpu)


From: Dimi Shahbaz
Subject: Cross GCC3 for PPC (no fpu)
Date: Wed, 05 Jun 2002 17:55:47 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc2) Gecko/20020510

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.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]