From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMi5L-000844-Ko for qemu-devel@nongnu.org; Thu, 19 Sep 2013 13:32:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMi5G-0004GN-2n for qemu-devel@nongnu.org; Thu, 19 Sep 2013 13:32:11 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=37278 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMi5F-0004Dd-SO for qemu-devel@nongnu.org; Thu, 19 Sep 2013 13:32:06 -0400 Message-ID: <523B3507.8040301@weilnetz.de> Date: Thu, 19 Sep 2013 19:31:51 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1378485978-32108-1-git-send-email-sw@weilnetz.de> <522A0FC9.6090205@weilnetz.de> In-Reply-To: <522A0FC9.6090205@weilnetz.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user: Fix wrong use of stat instead of stat64 for sparc64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Riku Voipio , Richard Henderson , qemu-devel , qemu-stable Am 06.09.2013 19:24, schrieb Stefan Weil: > Am 06.09.2013 19:16, schrieb Peter Maydell: >> On 6 September 2013 17:46, Stefan Weil wrote: >>> This test case is fixed now: >>> sparc64-linux-user/qemu-sparc64 /usr/gnemul/qemu-sparc64/busybox ls -l block.c >>> >>> Signed-off-by: Stefan Weil >>> --- >>> linux-user/syscall.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c >>> index ecead51..e498a92 100644 >>> --- a/linux-user/syscall.c >>> +++ b/linux-user/syscall.c >>> @@ -4764,7 +4764,7 @@ static inline abi_long host_to_target_stat64(void *cpu_env, >>> } else >>> #endif >>> { >>> -#if TARGET_ABI_BITS == 64 && !defined(TARGET_ALPHA) >>> +#if TARGET_ABI_BITS == 64 && !defined(TARGET_ALPHA) && !defined(TARGET_SPARC64) >>> struct target_stat *target_st; >>> #else >>> struct target_stat64 *target_st; >> So this condition is trying to identify the platforms >> which don't actually have a struct stat64 (which is >> some but not all of the 64 bit platforms). I think that >> rather than trying to enumerate those here it would >> be better if in the sections of syscall_defs.h which >> define target_stat/target_stat64 we had those sections >> which don't have a target_stat64 definition instead >> #define TARGET_NO_STRUCT_STAT64 >> and then used that here. >> >> -- PMM > I even thought about a totally different solution: > > Could we write some sample code with all those structs > and system calls, compile it once for each target, and > get all information we need from the resulting binaries > (using tools like pahole, for example)? > > For the moment, I think my patch is sufficient (it is also > needed for QEMU 1.6!). > > Stefan Ping? Are there any more opinions how qemu-sparc64 should be fixed? Should we choose Peter's approach (which is good, but with a higher risk than my patch)? Stefan