[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: SH4 issue and fstat64
From: |
Måns Rullgård |
Subject: |
[Qemu-devel] Re: SH4 issue and fstat64 |
Date: |
Sat, 10 Jan 2009 14:03:05 +0000 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (Instant Classic, linux) |
"Laurent Desnogues" <address@hidden> writes:
> Hello,
>
> after spending two hours to find and fix a simple hello world
> program failed on sh4, I found the issue had already been found:
>
> http://www.nabble.com/sh4-linux-user-emulation-on-an-x86_64-system-td19998891.html
>
> I can confirm that the packing of the structure proposed by Takashi Yoshii
> and Michael Trimarchi fixes the problem on my x86_64 system. I also
> checked it does not break i386 qemu on my machine.
I can confirm the fix as well. For the record, this is the patch I
used:
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 86c9d82..ba9ef8d 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1475,7 +1475,7 @@ struct target_stat {
/* This matches struct stat64 in glibc2.1, hence the absolutely
* insane amounts of padding around dev_t's.
*/
-struct target_stat64 {
+struct __attribute__((__packed__)) target_stat64 {
unsigned long long st_dev;
unsigned char __pad0[4];
--
Måns Rullgård
address@hidden