* [Qemu-devel] SH4 issue and fstat64
@ 2009-01-09 23:07 Laurent Desnogues
2009-01-10 14:03 ` [Qemu-devel] " Måns Rullgård
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Desnogues @ 2009-01-09 23:07 UTC (permalink / raw)
To: qemu-devel
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.
If someone needs a reproducer feel free to contact me.
This could have been frustrating, but now I know a little bit of sh4,
so that was not useless :-)
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] Re: SH4 issue and fstat64
2009-01-09 23:07 [Qemu-devel] SH4 issue and fstat64 Laurent Desnogues
@ 2009-01-10 14:03 ` Måns Rullgård
0 siblings, 0 replies; 3+ messages in thread
From: Måns Rullgård @ 2009-01-10 14:03 UTC (permalink / raw)
To: qemu-devel
"Laurent Desnogues" <laurent.desnogues@gmail.com> 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
mans@mansr.com
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] SH4 issue and fstat64
@ 2009-01-09 23:06 Laurent Desnogues
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Desnogues @ 2009-01-09 23:06 UTC (permalink / raw)
To: qemu-devel
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.
If someone needs a reproducer feel free to contact me.
This could have been frustrating, but now I know a little bit of sh4,
so that was not useless :-)
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-10 14:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-09 23:07 [Qemu-devel] SH4 issue and fstat64 Laurent Desnogues
2009-01-10 14:03 ` [Qemu-devel] " Måns Rullgård
-- strict thread matches above, loose matches on Subject: below --
2009-01-09 23:06 [Qemu-devel] " Laurent Desnogues
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).