Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C7Dhs-00075k-MI for qemu-devel@nongnu.org; Tue, 14 Sep 2004 09:50:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C7Dhr-00075L-HM for qemu-devel@nongnu.org; Tue, 14 Sep 2004 09:50:52 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C7Dhr-00075A-9s for qemu-devel@nongnu.org; Tue, 14 Sep 2004 09:50:51 -0400 Received: from [192.76.135.70] (helo=kurt.tools.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C7Dbz-0001uO-Om for qemu-devel@nongnu.org; Tue, 14 Sep 2004 09:44:48 -0400 Received: from tiger2.tools.intra (tiger2.tools.intra [172.20.0.11]) by kurt.tools.de (8.12.11/8.12.11) with ESMTP id i8EDid9Y001772 for ; Tue, 14 Sep 2004 15:44:39 +0200 (MEST) Received: from tiger2.tools.intra (tiger2.tools.intra [IPv6:2::20:208:c7ff:feaa:83b8]) by tiger2.tools.intra (8.12.10+Sun/8.12.10) with SMTP id i8EDidWO029239 for ; Tue, 14 Sep 2004 15:44:39 +0200 (CEST) Message-Id: <200409141344.i8EDidWO029239@tiger2.tools.intra> Date: Tue, 14 Sep 2004 15:44:39 +0200 (CEST) From: Juergen Keil Subject: Re: [Qemu-devel] Patch: java problems, llrint() macro truncates result to 32-bit [was: 0.60 Solaris 9 problems.] MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: zbAWWN4um9eXuGIBS//6VA== Reply-To: Juergen Keil , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > > The java virtual machine included in Solaris x86 > > does not work > > for me. When I start "java", I get: > > Sounds like It'll be some time before I start worrying > about a lack of JVM. Reason for the java VM crash was a buggy llrint() macro in target-i386/exec.h, it was truncating the result to a 32-bit value, on "_BSD" platforms. (I'm using the _BSD code on the Solaris platform) The following patch fixes the problem: Index: target-i386/exec.h =================================================================== RCS file: /cvsroot/qemu/qemu/target-i386/exec.h,v retrieving revision 1.14 diff -u -B -r1.14 exec.h --- target-i386/exec.h 5 Jul 2004 21:25:17 -0000 1.14 +++ target-i386/exec.h 14 Sep 2004 13:38:34 -0000 @@ -310,12 +314,12 @@ #define rint rintl #endif #if !defined(_BSD) extern int lrint(CPU86_LDouble x); extern int64_t llrint(CPU86_LDouble x); #else -#define lrint(d) ((int)rint(d)) -#define llrint(d) ((int)rint(d)) +#define lrint(d) ((long)rint(d)) +#define llrint(d) ((long long)rint(d)) #endif extern CPU86_LDouble fabs(CPU86_LDouble x); extern CPU86_LDouble sin(CPU86_LDouble x);