libffi & powerpc
David Daney
ddaney@avtrex.com
Mon May 14 16:11:00 GMT 2007
Patrick Olinet wrote:
> Running with gdb, it looks like the problem comes from the
> ppc_closure.S file of the libffi/src/powerpc directory, at line 32 :
>
> stfd %f1, 48(%r1)
>
> I don't understand anything to powerpc assembly, but after a google
> search, "stfd" means "store floating-point double". But the PPC405
> doesn't have any FPU, so I guess that's why it throws an "illegal
> instruction".
>
> I've compiled again my cross toolchain with the "--with-float=soft"
> option, hoping that it would emulate FPU instruction, but this
> unfortunately doesn't help... I'm nevertheless not sure that this
> option is the right one...
If your entire toolchain is compiled with --with-float=soft, then you
should use the same options when compiling your code.
>
> Any thoughts ? Is there a bug in libffi in that it doesn't support
> powerpc CPU without FPU ?
>
>
It would seem so.
For the MIPS port, we had the same issue. The solution is to fix libffi
so that it handles the soft float ABI. In order to fix it you would
probably have to write PPC assembly code and have some knowledge of the
ABI being used.
A work-around might be to disable libffi closures and the libgcj
interpreter for the soft-float ABI.
David Daney
>
>
>
>
> On 5/8/07, Andrew Haley <aph-gcc@littlepinkcloud.com> wrote:
>> Patrick Olinet writes:
>> > Hi there,
>> >
>> > I'm running an embedded platform based on a powerpc 405EP CPU and a
>> > gcc 4.1.0 cross-toolchain. My initial problem was that gcj compiled
>> > binaries crash at runtime when interpreting java bytecode ("Illegal
>> > instruction" message).
>> >
>> > After many investigations, it looks like the problem comes from the
>> > libffi library : I've run the libffi testsuite on my embedded
>> paltform
>> > and many of the tests show the same "Illegal instruction" message.
>> For
>> > instance, the "cls_uint" test crashes at the following line (from the
>> > cls_uint.c file) :
>> >
>> > res = (*((cls_ret_uint)pcl))(2147483647);
>> >
>> > My knowledge about the powerpc architectures is very limited, but
>> I've
>> > seen mailing lists threads talking about "EABI" that I don't quite
>> > understand but my intuition is that it could be related. For
>> instance,
>> > could it be that my cross toolchain is not compiled with the right
>> > EABI (does this question make sense??) ?
>> >
>> > Any ideas or thoughts about this problem ?
>>
>> Run it in gdb. When gdb stops with SIGILL, do
>>
>> x/i $pc
>>
>> Andrew.
>>
More information about the Gcc
mailing list