Soft Float for PC386

Angelo Fraietta angelo at
Tue Feb 27 07:38:13 UTC 2001

The computer no longer re-boots when running two tasks with  the -mno-fp-ret-in-387 flags.
However, there are still co-processor commands occuring. This is where the exception occurs:

with CPU_CFLAGS =-msoft-float -mno-fp-ret-in-387

  10ba89: 5e                    pop    %esi
  10ba8a: 5f                    pop    %edi
  10ba8b: dd 45 f0              fldl   0xfffffff0(%ebp)
  10ba8e: c9                    leave

Ralf Corsepius wrote:

> Angelo Fraietta wrote:
> >
> > If I build the pc386 with both the -mno-fp-ret-in-387 and the -msoft-float flags
> > the machine re-boots if you try to create a task. Eg, if you try to run the
> > ticker sample, the machine re-boots.  If you only use the -msoft-float and not
> > the -mno-fp-ret-in-387 flag, the tasks run OK.
> > I am mentioning this because the ts_386ex build uses both flags, and so if
> > someone tests these on a ts_386ex, they may want to try running ticker on it to
> > see if it crashes.
> >
> This doesn't surprize me, because newlib unconditionally inserts
> FPU-code into its libc, no matter which compiler options are used
> for building it. I.e. at least one cause of your problems is lurking
> in newlib.
> I believe to have fixed this issue, so you could consider rebuilding
> your gcc-newlib rpms, using the *.nosrc.rpm below, which contains my
> fixes.
> Procedure for rebuilding:
> 1) Copy gcc-2.95.2.tar.gz and newlib-1.9.0.tar.gz to
> /usr/src/redhat/SOURCES.
> 2) rpm -i i386-rtems-gcc-newlib-gcc2.95.2newlib1.9.0-1.nosrc.rpm
> [This will install RTEMS diffs and my patches to
> /usr/src/redhat/SOURCES]
> 3)
> export PATH=/opt/rtems/bin:$PATH
> rpm -bb
> /usr/src/redhat/SPECS/i386-rtems-gcc-newlib-gcc2.95.2newlib1.9.0.spec
> [Now wait a couple of hours for the built to finish. Requires 500MB
> to 1GB of free diskspace below /usr/src/redhat]
> 4) /usr/src/redhat/RPMS/i386 now should contain the new
> i386-rtems-*.rpms
> 5) Rebuild RTEMS w/ -msoft-float -mno-fp-ret-in-387.
> 6) Test at run-time.
> Hope that helps.
> FYI: These patches already are submitted to Joel and to the newlib
> maintainers.
> AFAIK, Joel already is preparing new RTEMS toolchain rpms. So if you
> can't build the toolchain yourself for some reason, it's probably
> only a matter of days until new RTEMS toolchain rpms will appear on
> OAR's site.
> Ralf
> --
> Ralf Corsepius
> Forschungsinstitut fuer Anwendungsorientierte Wissensverarbeitung
> (FAW)
> Helmholtzstr. 16, 89081 Ulm, Germany     Tel: +49/731/501-8690
> mailto:corsepiu at           FAX: +49/731/501-999
>   ------------------------------------------------------------------------
>                                                              Name: i386-rtems-gcc-newlib-gcc2.95.2newlib1.9.0-1.nosrc.rpm
>    i386-rtems-gcc-newlib-gcc2.95.2newlib1.9.0-1.nosrc.rpm    Type: RealPlayer(tm) as Plug-in (audio/x-pn-realaudio-plugin)
>                                                          Encoding: base64

Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)

More information about the users mailing list