[kaffe] softfp broken in gnu-classpath on ARM EABI? Was: Re: ARM EABI fixed cache_flush but broken VMDouble.toString

ronaldsloot ronaldsloot at yahoo.com
Tue Jun 5 07:46:25 PDT 2007


As it is now, for EABI the flush_dcache function in configs/arm/linux/md.c
looks wrong. I have had random illegal instructions because of this. For
EABI register r7 needs to carry the syscall number and register r2 needs to
be 0 (I saw this was already changed before).

Can you try the following flush_dache function and let me know the results ?

void flush_dcache(void *start, void *end) {
  __asm __volatile (
            "stmfd sp!, {r7}\n"
            "ldr r7, =" __sys1(__ARM_NR_cacheflush) "\n"
            "bic r7, r7, #0x900000\n"
            "mov r0, %0\n"
            "mov r1, %1\n"
            "mov r2, #0\n"
            "swi #0\n"
            "ldmfd sp!, {r7}\n"
            : /* no return value */
            : "r" ((long)start), "r" ((long)end)
            : "r0","r1","r2");
}

-- Ronald



Steven Newbury wrote:
> 
> 
> --- Steven Newbury <s_j_newbury at yahoo.co.uk> wrote:
> 
> 
>> zaurus java # java HelloWorldApp       
>> Internal error: caught an unexpected exception.
>> Please check your CLASSPATH and your installation.
>> java/lang/UnsatisfiedLinkError: Failed to locate native function:      
>> java/lang/VMDouble.toString(DZ)Ljava/lang/String;
>>    at java.lang.ClassLoader.getSystemClassLoader (ClassLoader.java:799)
>> Aborted
>> 
>> I'm working against a checkout of the current kaffe CVS.
>> 
>> My target machine is a PXA270 with a iwmmxt native gcc-4.3 toolchain
>> (using
>> -ftree-vectorize), so softfloat only.  Disassembly of
>> libkaffevm-1.1.8-pre.so
>> shows the functions handling doubles etc using 64bit iWMMXt registers
>> which
>> is
>> nice.
>> 
>> I'm going to do more digging and see if I can figure it out.
>> 
> 
> I've been doing more testing.  I built jamvm and while it runs I get:
> import java.io.*;
> 
> public class FloatTest
> {
>   public static void main (String[]args)
>   {
>     System.err.println ((float) 100000000);
>   }
> }
> 
> zaurus bugs # java FloatTest
> NaN
> 
> While with kaffe I get:
> zaurus bugs # java FloatTest
> Internal error: caught an unexpected exception.
> Please check your CLASSPATH and your installation.
> java/lang/UnsatisfiedLinkError: Failed to locate native function:      
> java/lang/VMDouble.toString(DZ)Ljava/lang/String;
>    at java.lang.ClassLoader.getSystemClassLoader (ClassLoader.java:799)
> Aborted
> 
> ...or sometimes...
> 
> zaurus bugs # java FloatTest
> Illegal instruction
> 
> Unfortunately when I tried to use KAFFE_DEBUG=gdb
> 
> zaurus bugs # KAFFE_DEBUG=gdb java FloatTest
> GNU gdb 6.6
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "arm-iwmmxt-linux-gnueabi"...
> (no debugging symbols found)
> Using host libthread_db library "/lib/libthread_db.so.1".
> (gdb) run
> Starting program: /usr/opt/kaffe-9999/jre/bin/kaffe-bin FloatTest
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> [Thread debugging using libthread_db enabled]
> [New Thread 1073873152 (LWP 21821)]
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1073873152 (LWP 21821)]
> 0x4008cba8 in KaffePThread_detectStackBoundaries () from
> /opt/kaffe-9999/jre/lib/arm/libkaffevm-1.1.8-pre.so
> (gdb) cont
> Continuing.
> 
> Program received signal SIGILL, Illegal instruction.
> 0x0018ef54 in ?? ()
> (gdb) bt
> #0  0x0018ef54 in ?? ()
> (gdb) disassemble
> No function contains program counter for selected frame.
> (gdb)
> 
> I'm using Gentoo portage and it strips the binaries by default, I'm going
> to
> try it without and see if it makes a difference.
> 
> I'm leaning towards a classpath bug, I'm just a bit surprised it hasn't
> come up
> previously...???
> 
> This is an experimental toolchain, but I have built a full system with it,
> including KDE(!), so while not impossible a bug there seems less likely.
> 
> 
> Steve
> 
> 
>       ___________________________________________________________ 
> Check out the All New Yahoo! Mail blog http://ymailuk.com/
> 
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
> 
> 

-- 
View this message in context: http://www.nabble.com/ARM-EABI-fixed-cache_flush-but-broken-VMDouble.toString-tf3662195.html#a10970957
Sent from the kaffe general mailing list archive at Nabble.com.





More information about the kaffe mailing list