[Bug libffi/31937] New: libffi doesn't support ppc without FPU

2007-05-15 Thread patrick dot olinet at gmail dot com
PowerPC CPU without FPU (such as the PPC405EP) doesn't pass the libffi
testsuite. Most of the tests crash with an "illegal instruction" error message,
even those that don't manipulate double/float. For instance, it crashes with
the "cls_uint" test.

After investigating, I think the problem comes from the ppc assembly code from
the libffi/src/powerpc directory that includes FPU instructions not supported
by those CPU. In particular, the ppc_closure.S file contains "stfd" FPU
instructions that are supposed to save FPU registers and are always executed,
even if no fpu operation is to be performed.

If you don't need fpu support (as I do), a quick and dirty hack is to comment
out those "stfd" instructions from the ppc_closure.S file.

I guess the right way to fix it would be to use the soft-float system when no
FPU is present. But that's something I don't know how to do...

I've tried with gcc 3.4.3 and gcc 4.1.0, but I guess all versions are affected.


-- 
   Summary: libffi doesn't support ppc without FPU
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libffi
    AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: patrick dot olinet at gmail dot com
 GCC build triplet: i686-linux-gnu
  GCC host triplet: powerpc-405-linux-gnu
GCC target triplet: powerpc-405-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937



[Bug libffi/31937] libffi doesn't support ppc without FPU

2007-05-16 Thread patrick dot olinet at gmail dot com


--- Comment #1 from patrick dot olinet at gmail dot com  2007-05-16 14:23 
---

Notice that this bug prevents loading and running java bytecode from a native
code binary compiled with gcj. I guess it relies on libffi to call the methods
of the bytecode.

This java problem is what I've encountered first before investigating and
finding out that it all comes from libfii.


-- 

patrick dot olinet at gmail dot com changed:

   What|Removed |Added

 CC||patrick dot olinet at gmail
   |    |dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937