From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzEfb-0005F4-8c for qemu-devel@nongnu.org; Thu, 22 May 2008 13:33:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzEfZ-0005CJ-Gp for qemu-devel@nongnu.org; Thu, 22 May 2008 13:33:38 -0400 Received: from [199.232.76.173] (port=55503 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzEfZ-0005By-7m for qemu-devel@nongnu.org; Thu, 22 May 2008 13:33:37 -0400 Received: from csl.cornell.edu ([128.84.224.10]:2281 helo=vlsi.csl.cornell.edu) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JzEfZ-0000MO-Br for qemu-devel@nongnu.org; Thu, 22 May 2008 13:33:37 -0400 Received: from bell.csl.cornell.edu (bell.csl.cornell.edu [128.84.224.41]) by vlsi.csl.cornell.edu (8.13.4/8.13.4) with ESMTP id m4MHXQe5009263 for ; Thu, 22 May 2008 13:33:31 -0400 (EDT) Date: Thu, 22 May 2008 13:33:26 -0400 (EDT) From: Vince Weaver Message-ID: <20080522133001.O38215-100000@bell.csl.cornell.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [Qemu-devel] MIPS linux-user ftruncate64 patch Reply-To: 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 Hello the below patch is needed for ftruncate64() to work properly when simulating a 32-bit mips binary using linux-user on an x86 system. Without this fix, the "sixtrack" fortran benchmark from the SPEC CPU 2000 benchmark suite fails to run. I am not familar enough with the register layout for the ftruncate64() syscall to know if something unusual is going on with how MIPS binaries call this, or if this is a weird big/little endian or 32/64bit issue. It does seem suspicious that arm/eabi also needs a similar fix in this function. Vince --- svn/linux-user/syscall.c 2008-04-23 12:23:06.000000000 -0400 +++ svn.dinero/linux-user/syscall.c 2008-05-22 13:28:44.000000000 -0400 @@ -3026,6 +3026,11 @@ arg3 = arg4; } #endif + +#ifdef TARGET_MIPS + arg2 = arg4; +#endif + return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3))); } #endif