[uClibc] 386 floating point

Jeff Baitis baitisj at evolution.com
Wed Oct 8 19:33:48 UTC 2003


Hi all:

Forgive me if this is a double post. I apparently had some mail problems yesterday.


I am of the opinion that uClibC-targeted compilers should be able to
generate either soft-float or hard-float compatible output. As such, I
suggest that the following changes be made to the buildroot and
toolchain tools.

Here's a patch to be included in either buildroot/sources or
toolchain/gcc-3.3.1/sources that should enable soft-float.

        $ cat gcc-8765-soft-float.patch 
        --- gcc-3.3.1/gcc/config/t-linux.old    2003-10-02
        20:52:56.000000000 -0700
        +++ gcc-3.3.1/gcc/config/t-linux   2003-10-02 20:53:34.000000000
        -0700
        @@ -3,8 +3,8 @@
         
         # Compile crtbeginS.o and crtendS.o with pic.
         CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
        -# Compile libgcc2.a with pic.
        -TARGET_LIBGCC2_CFLAGS = -fPIC
        +# Compile libgcc2.a with pic and soft float support
        +TARGET_LIBGCC2_CFLAGS = -fPIC -msoft-float
         
         # Override t-slibgcc-elf-ver to export some libgcc symbols with
         # the symbol versions that glibc used.

The following change needs to be done to the Makefiles. For buildroot:

        $ cvs diff -u Makefile
        Index: Makefile
        ===================================================================
        RCS file: /var/cvs/buildroot/Makefile,v
        retrieving revision 1.59
        diff -u -r1.59 Makefile
        --- Makefile    30 Sep 2003 20:59:17 -0000      1.59
        +++ Makefile    6 Oct 2003 21:31:09 -0000
        @@ -65,7 +65,8 @@
         #OPTIMIZE_FOR_CPU=whatever
         
         # Any additional gcc options you may want to include....
        -EXTRA_GCC_CONFIG_OPTIONS=
        +EXTRA_GCC_CONFIG_OPTIONS=--with-float=-msoft-float
        +#EXTRA_GCC_CONFIG_OPTIONS=
         #EXTRA_GCC_CONFIG_OPTIONS=--without-float
         
         # Enable the following if you want locale/gettext/i18n support.
        
And, for toolchain:

        $ cvs diff -u Makefile
        Index: Makefile
        ===================================================================
        RCS file: /var/cvs/toolchain/gcc-3.3.1/Makefile,v
        retrieving revision 1.4
        diff -u -r1.4 Makefile
        --- Makefile    10 Sep 2003 09:04:27 -0000      1.4
        +++ Makefile    6 Oct 2003 21:34:49 -0000
        @@ -63,7 +63,7 @@
         #OPTIMIZE_FOR_CPU=whatever
         
         # Any additional gcc options you may want to include....
        -EXTRA_GCC_CONFIG_OPTIONS=
        +EXTRA_GCC_CONFIG_OPTIONS=--with-float=-msoft-float
         #############################################################
         #
         # What shall we build today?
                         

I think that these changes should enable the -msoft-float compiler
option on all targets, although I have only tested the mipsel target
extensively.

I hope you find this information useful.

Thanks again, Mr. Andersen (neo?) ;)

-Jeff



On Tue, 2003-09-30 at 12:31, Erik Andersen wrote:
> On Tue Sep 30, 2003 at 07:47:32PM +0100, david stevenson wrote:
> > Eric
> 
> s/Eric/Erik/
> :-)
> 
> > Do you know how to do this?
> > I am now using Thomas's suggestion of using kernel support, but I had tried to 
> > build gcc with soft-float without finding the magic. 2.95.3 has a file 
> > softfloat.c but I could not find the right way to include it.
> 
> I believe the missing soft-float routines are defined in
> <gcc-dir>/gcc/config/fp-bit.[ch]
> 
> I'm guessing that soft-float on x86 probably requires that you
> modify <gcc-dir>/gcc/config/i386/t-i386elf so that it does the
> soft-float stuff, similar to what is done in t-rtems-i386.
> 
> i.e. Making soft-float work on x86 appears to not be supported
> by gcc w/o doing some hacking on the compiler to set that up.
> 
> Clearly the path of least resistance is to use the kernel FPU
> emulator,
> 
>  -Erik
> 
> --
> Erik B. Andersen             http://codepoet-consulting.com/
> --This message was written using 73% post-consumer electrons--
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://uclibc.org/mailman/listinfo/uclibc

--
         Jeffrey Baitis - Associate Software Engineer

                    Evolution Robotics, Inc.
                     130 West Union Street
                       Pasadena CA 91103

 tel: 626.535.2776  |  fax: 626.535.2777  |  baitisj at evolution.com 




More information about the uClibc mailing list