* [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.
@ 2007-11-20 14:48 takasi-y
2007-11-21 0:24 ` Magnus Damm
0 siblings, 1 reply; 7+ messages in thread
From: takasi-y @ 2007-11-20 14:48 UTC (permalink / raw)
To: qemu-devel
Hello,
I found 6th arg for syscall is missing on SH4 linux-user emulation.
This seems to be the cause of shared library mapping failure.
I successfully run shared-lib'd binary, after applying following fix.
/yoshii
diff -u -r1.155 main.c
--- a/linux-user/main.c 17 Nov 2007 01:37:43 -0000 1.155
+++ b/linux-user/main.c 20 Nov 2007 14:09:59 -0000
@@ -1613,7 +1613,7 @@
env->gregs[6],
env->gregs[7],
env->gregs[0],
- 0);
+ env->gregs[1]);
env->gregs[0] = ret;
env->pc += 2;
break;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.
2007-11-20 14:48 [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall takasi-y
@ 2007-11-21 0:24 ` Magnus Damm
2007-11-21 1:43 ` Tomoyoshi ASANO
0 siblings, 1 reply; 7+ messages in thread
From: Magnus Damm @ 2007-11-21 0:24 UTC (permalink / raw)
To: qemu-devel
Hi there,
On Nov 20, 2007 11:48 PM, <takasi-y@ops.dti.ne.jp> wrote:
> I found 6th arg for syscall is missing on SH4 linux-user emulation.
> This seems to be the cause of shared library mapping failure.
> I successfully run shared-lib'd binary, after applying following fix.
Hehe, I managed to create the exact same patch yesterday evening. So
this email is just to acknowledge this fix. Dynamically linked
binaries using uclibc-0.9.29 or glibc-2.3.6 both work well. Thank you.
/ magnus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.
2007-11-21 0:24 ` Magnus Damm
@ 2007-11-21 1:43 ` Tomoyoshi ASANO
2007-11-21 5:07 ` Tomoyoshi ASANO
0 siblings, 1 reply; 7+ messages in thread
From: Tomoyoshi ASANO @ 2007-11-21 1:43 UTC (permalink / raw)
To: qemu-devel
Hell,
This is very nice!
I tested using glibc-2.5
It seems good.
Thank you
On Wed, 21 Nov 2007 09:24:41 +0900
"Magnus Damm" <magnus.damm@gmail.com> wrote:
> Hi there,
>
> On Nov 20, 2007 11:48 PM, <takasi-y@ops.dti.ne.jp> wrote:
> > I found 6th arg for syscall is missing on SH4 linux-user emulation.
> > This seems to be the cause of shared library mapping failure.
> > I successfully run shared-lib'd binary, after applying following fix.
>
> Hehe, I managed to create the exact same patch yesterday evening. So
> this email is just to acknowledge this fix. Dynamically linked
> binaries using uclibc-0.9.29 or glibc-2.3.6 both work well. Thank you.
>
> / magnus
>
-- あさの
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.
2007-11-21 1:43 ` Tomoyoshi ASANO
@ 2007-11-21 5:07 ` Tomoyoshi ASANO
2007-11-21 8:12 ` Magnus Damm
2007-11-21 9:50 ` Fabrice Bellard
0 siblings, 2 replies; 7+ messages in thread
From: Tomoyoshi ASANO @ 2007-11-21 5:07 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2791 bytes --]
Hello,
I tested big-endian binaries by sh4(eb)-linux-user
with a small patch(attached) for building sh4eb-linux-user.
But I don't understand that this patch is needed or not.
sh4eb-linux-user is OK using static link binaries.
But I feel that sh4eb-linux-users has some problem(?)
using dynamic link binaries.
1) If host-os has /etc/ld.so.cache, sh4eb-linux-users is NG.
[root@triton ~] qemu-sh4eb -strace /usr/qemu-sh4eb/bin/busybox
28575 uname(0x4007f818) = 0
28575 brk(0,132617,1074264468,57,1074325300,4096) = 0x00487000
28575 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or
directory)
28575 open("/etc/ld.so.cache",0,01) = 3
28575 fstat64(3,0x4007f234) = 0
28575 mmap(0,66277,1,2,3,0) = 0x42081000
28575 close(3) = 0
Unhandled trap: 0xa0
pc=0x400870d0 sr=0x00008001 pr=0x40086e32 fpscr=0x00080000
r0=0x00000348 r1=0xb61a0ff4 r2=0x2a2c1010 r3=0x0000000c
r4=0x400a4000 r5=0x40092afc r6=0x0000000b r7=0x00000002
r8=0x7411fff4 r9=0x000102e5 r10=0x1f017fff r11=0x17dd02d5
r12=0x400a4000 r13=0x3e02ffff r14=0x4007f2b0 r15=0x4007f2b0
r16=0x00000000 r17=0x00000000 r18=0x00000000 r19=0x00000000
r20=0x00000000 r21=0x00000000 r22=0x00000000 r23=0x00000000
But if no /etc/ld.so.cache in host-os, sh4eb-linux-users is OK.
2) If host-os has /lib/tls/*, sh4eb-linux-users is NG.
root@triton ~] qemu-sh4eb -strace /usr/qemu-sh4eb/bin/busybox
28580 uname(0x4007f818) = 0
28580 brk(0,132617,1074264468,57,1074325300,4096) = 0x00487000
28580 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or
directory)
28580 open("/etc/ld.so.cache",0,01) = -1 errno=2 (No such file or
directory)
28580 open("/lib/tls/libm.so.6",0,012) = 3
28580 read(3,0x4007f308,512) = 512
28580 close(3) = 0
28580 writev(2,0x4007efb8,0xa)/usr/qemu-sh4eb/bin/busybox: error
while loading shared libraries: /lib/tls/libm.so.6: ELF file data
encoding not big-endian
= 125
28580 exit_group(127)
But if no /lib/tls in host-os, sh4eb-linux-users is OK.
please help if possible.
Thanks,
--
On Wed, 21 Nov 2007 10:43:49 +0900
Tomoyoshi ASANO <asa@lineo.co.jp> wrote:
> Hell,
>
> This is very nice!
>
> I tested using glibc-2.5
> It seems good.
>
> Thank you
>
> On Wed, 21 Nov 2007 09:24:41 +0900
> "Magnus Damm" <magnus.damm@gmail.com> wrote:
>
> > Hi there,
> >
> > On Nov 20, 2007 11:48 PM, <takasi-y@ops.dti.ne.jp> wrote:
> > > I found 6th arg for syscall is missing on SH4 linux-user emulation.
> > > This seems to be the cause of shared library mapping failure.
> > > I successfully run shared-lib'd binary, after applying following fix.
> >
> > Hehe, I managed to create the exact same patch yesterday evening. So
> > this email is just to acknowledge this fix. Dynamically linked
> > binaries using uclibc-0.9.29 or glibc-2.3.6 both work well. Thank you.
> >
> > / magnus
> >
>
[-- Attachment #2: qemu-snapshot-sh4eb.patch --]
[-- Type: application/octet-stream, Size: 2156 bytes --]
diff -Nru qemu.orig/Makefile qemu/Makefile
--- qemu.orig/Makefile 2007-11-19 06:33:07.000000000 +0900
+++ qemu/Makefile 2007-11-21 12:21:52.000000000 +0900
@@ -245,6 +245,7 @@
$(bindir)/qemu-system-arm \
$(bindir)/qemu-system-m68k \
$(bindir)/qemu-system-sh4 \
+ $(bindir)/qemu-system-sh4eb \
$(bindir)/qemu-i386 \
$(bindir)/qemu-arm \
$(bindir)/qemu-armeb \
@@ -260,6 +261,7 @@
$(bindir)/qemu-alpha \
$(bindir)/qemu-m68k \
$(bindir)/qemu-sh4 \
+ $(bindir)/qemu-sh4eb \
$(bindir)/qemu-img \
$(datadir)/bios.bin \
$(datadir)/vgabios.bin \
diff -Nru qemu.orig/configure qemu/configure
--- qemu.orig/configure 2007-11-19 06:37:07.000000000 +0900
+++ qemu/configure 2007-11-21 12:22:25.000000000 +0900
@@ -522,11 +522,11 @@
if test -z "$target_list" ; then
# these targets are portable
if [ "$softmmu" = "yes" ] ; then
- target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu cris-softmmu"
+ target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu sh4eb-softmmu cris-softmmu"
fi
# the following are Linux specific
if [ "$linux_user" = "yes" ] ; then
- target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user x86_64-linux-user cris-linux-user $target_list"
+ target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user sh4eb-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user x86_64-linux-user cris-linux-user $target_list"
fi
# the following are Darwin specific
if [ "$darwin_user" = "yes" ] ; then
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.
2007-11-21 5:07 ` Tomoyoshi ASANO
@ 2007-11-21 8:12 ` Magnus Damm
2007-11-21 9:50 ` Fabrice Bellard
1 sibling, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2007-11-21 8:12 UTC (permalink / raw)
To: qemu-devel
Hi there,
On Nov 21, 2007 2:07 PM, Tomoyoshi ASANO <asa@lineo.co.jp> wrote:
> I tested big-endian binaries by sh4(eb)-linux-user
> with a small patch(attached) for building sh4eb-linux-user.
> But I don't understand that this patch is needed or not.
I'm not sure if that patch is all that is needed. You may need to
change more things like TARGET_WORDS_BIGENDIAN in the configure
script.
> sh4eb-linux-user is OK using static link binaries.
>
> But I feel that sh4eb-linux-users has some problem(?)
> using dynamic link binaries.
>
> 1) If host-os has /etc/ld.so.cache, sh4eb-linux-users is NG.
[snip log]
> But if no /etc/ld.so.cache in host-os, sh4eb-linux-users is OK.
>
> 2) If host-os has /lib/tls/*, sh4eb-linux-users is NG.
[snip log]
> But if no /lib/tls in host-os, sh4eb-linux-users is OK.
>
> please help if possible.
I have not tested sh in big endian mode yet, so I'm not sure what
issues you may run into. I have however noticed that regardless of
endian target libraries may feel the need of loading host files such
as /etc/ld.so.cache which in turn may lead to some serious confusion.
Maybe the path remapping engine in scratchbox2 solves this issue?
http://www.freedesktop.org/wiki/Software/sbox2
The release sbox2-1.99.0.19 does not support SH out of the box, but
the latest git version should be ok.
Good luck!
/ magnus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.
2007-11-21 5:07 ` Tomoyoshi ASANO
2007-11-21 8:12 ` Magnus Damm
@ 2007-11-21 9:50 ` Fabrice Bellard
2007-11-21 22:41 ` Tomoyoshi ASANO
1 sibling, 1 reply; 7+ messages in thread
From: Fabrice Bellard @ 2007-11-21 9:50 UTC (permalink / raw)
To: qemu-devel
Can you provide a glibc and busybox binary for sh4eb so that I can
include them in the linux user tests ?
Regards,
Fabrice.
Tomoyoshi ASANO wrote:
> Hello,
>
> I tested big-endian binaries by sh4(eb)-linux-user
> with a small patch(attached) for building sh4eb-linux-user.
> But I don't understand that this patch is needed or not.
>
> sh4eb-linux-user is OK using static link binaries.
>
> But I feel that sh4eb-linux-users has some problem(?)
> using dynamic link binaries.
>
> 1) If host-os has /etc/ld.so.cache, sh4eb-linux-users is NG.
>
> [root@triton ~] qemu-sh4eb -strace /usr/qemu-sh4eb/bin/busybox
> 28575 uname(0x4007f818) = 0
> 28575 brk(0,132617,1074264468,57,1074325300,4096) = 0x00487000
> 28575 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or
> directory)
> 28575 open("/etc/ld.so.cache",0,01) = 3
> 28575 fstat64(3,0x4007f234) = 0
> 28575 mmap(0,66277,1,2,3,0) = 0x42081000
> 28575 close(3) = 0
> Unhandled trap: 0xa0
> pc=0x400870d0 sr=0x00008001 pr=0x40086e32 fpscr=0x00080000
> r0=0x00000348 r1=0xb61a0ff4 r2=0x2a2c1010 r3=0x0000000c
> r4=0x400a4000 r5=0x40092afc r6=0x0000000b r7=0x00000002
> r8=0x7411fff4 r9=0x000102e5 r10=0x1f017fff r11=0x17dd02d5
> r12=0x400a4000 r13=0x3e02ffff r14=0x4007f2b0 r15=0x4007f2b0
> r16=0x00000000 r17=0x00000000 r18=0x00000000 r19=0x00000000
> r20=0x00000000 r21=0x00000000 r22=0x00000000 r23=0x00000000
>
> But if no /etc/ld.so.cache in host-os, sh4eb-linux-users is OK.
>
> 2) If host-os has /lib/tls/*, sh4eb-linux-users is NG.
>
> root@triton ~] qemu-sh4eb -strace /usr/qemu-sh4eb/bin/busybox
> 28580 uname(0x4007f818) = 0
> 28580 brk(0,132617,1074264468,57,1074325300,4096) = 0x00487000
> 28580 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or
> directory)
> 28580 open("/etc/ld.so.cache",0,01) = -1 errno=2 (No such file or
> directory)
> 28580 open("/lib/tls/libm.so.6",0,012) = 3
> 28580 read(3,0x4007f308,512) = 512
> 28580 close(3) = 0
> 28580 writev(2,0x4007efb8,0xa)/usr/qemu-sh4eb/bin/busybox: error
> while loading shared libraries: /lib/tls/libm.so.6: ELF file data
> encoding not big-endian
> = 125
> 28580 exit_group(127)
>
> But if no /lib/tls in host-os, sh4eb-linux-users is OK.
>
> please help if possible.
>
> Thanks,
> --
>
> On Wed, 21 Nov 2007 10:43:49 +0900
> Tomoyoshi ASANO <asa@lineo.co.jp> wrote:
>
>> Hell,
>>
>> This is very nice!
>>
>> I tested using glibc-2.5
>> It seems good.
>>
>> Thank you
>>
>> On Wed, 21 Nov 2007 09:24:41 +0900
>> "Magnus Damm" <magnus.damm@gmail.com> wrote:
>>
>>> Hi there,
>>>
>>> On Nov 20, 2007 11:48 PM, <takasi-y@ops.dti.ne.jp> wrote:
>>>> I found 6th arg for syscall is missing on SH4 linux-user emulation.
>>>> This seems to be the cause of shared library mapping failure.
>>>> I successfully run shared-lib'd binary, after applying following fix.
>>> Hehe, I managed to create the exact same patch yesterday evening. So
>>> this email is just to acknowledge this fix. Dynamically linked
>>> binaries using uclibc-0.9.29 or glibc-2.3.6 both work well. Thank you.
>>>
>>> / magnus
>>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.
2007-11-21 9:50 ` Fabrice Bellard
@ 2007-11-21 22:41 ` Tomoyoshi ASANO
0 siblings, 0 replies; 7+ messages in thread
From: Tomoyoshi ASANO @ 2007-11-21 22:41 UTC (permalink / raw)
To: qemu-devel
Hello Fabrce-san,
I uploaded this URL
http://club.lineo.co.jp/~asa/
4535036 qemu-sh4eb.tar.bz2
Regards,
--
On Wed, 21 Nov 2007 10:50:22 +0100
Fabrice Bellard <fabrice@bellard.org> wrote:
> Can you provide a glibc and busybox binary for sh4eb so that I can
> include them in the linux user tests ?
>
> Regards,
>
> Fabrice.
>
> Tomoyoshi ASANO wrote:
> > Hello,
> >
> > I tested big-endian binaries by sh4(eb)-linux-user
> > with a small patch(attached) for building sh4eb-linux-user.
> > But I don't understand that this patch is needed or not.
> >
> > sh4eb-linux-user is OK using static link binaries.
> >
> > But I feel that sh4eb-linux-users has some problem(?)
> > using dynamic link binaries.
> >
> > 1) If host-os has /etc/ld.so.cache, sh4eb-linux-users is NG.
> >
> > [root@triton ~] qemu-sh4eb -strace /usr/qemu-sh4eb/bin/busybox
> > 28575 uname(0x4007f818) = 0
> > 28575 brk(0,132617,1074264468,57,1074325300,4096) = 0x00487000
> > 28575 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or
> > directory)
> > 28575 open("/etc/ld.so.cache",0,01) = 3
> > 28575 fstat64(3,0x4007f234) = 0
> > 28575 mmap(0,66277,1,2,3,0) = 0x42081000
> > 28575 close(3) = 0
> > Unhandled trap: 0xa0
> > pc=0x400870d0 sr=0x00008001 pr=0x40086e32 fpscr=0x00080000
> > r0=0x00000348 r1=0xb61a0ff4 r2=0x2a2c1010 r3=0x0000000c
> > r4=0x400a4000 r5=0x40092afc r6=0x0000000b r7=0x00000002
> > r8=0x7411fff4 r9=0x000102e5 r10=0x1f017fff r11=0x17dd02d5
> > r12=0x400a4000 r13=0x3e02ffff r14=0x4007f2b0 r15=0x4007f2b0
> > r16=0x00000000 r17=0x00000000 r18=0x00000000 r19=0x00000000
> > r20=0x00000000 r21=0x00000000 r22=0x00000000 r23=0x00000000
> >
> > But if no /etc/ld.so.cache in host-os, sh4eb-linux-users is OK.
> >
> > 2) If host-os has /lib/tls/*, sh4eb-linux-users is NG.
> >
> > root@triton ~] qemu-sh4eb -strace /usr/qemu-sh4eb/bin/busybox
> > 28580 uname(0x4007f818) = 0
> > 28580 brk(0,132617,1074264468,57,1074325300,4096) = 0x00487000
> > 28580 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or
> > directory)
> > 28580 open("/etc/ld.so.cache",0,01) = -1 errno=2 (No such file or
> > directory)
> > 28580 open("/lib/tls/libm.so.6",0,012) = 3
> > 28580 read(3,0x4007f308,512) = 512
> > 28580 close(3) = 0
> > 28580 writev(2,0x4007efb8,0xa)/usr/qemu-sh4eb/bin/busybox: error
> > while loading shared libraries: /lib/tls/libm.so.6: ELF file data
> > encoding not big-endian
> > = 125
> > 28580 exit_group(127)
> >
> > But if no /lib/tls in host-os, sh4eb-linux-users is OK.
> >
> > please help if possible.
> >
> > Thanks,
> > --
> >
> > On Wed, 21 Nov 2007 10:43:49 +0900
> > Tomoyoshi ASANO <asa@lineo.co.jp> wrote:
> >
> >> Hell,
> >>
> >> This is very nice!
> >>
> >> I tested using glibc-2.5
> >> It seems good.
> >>
> >> Thank you
> >>
> >> On Wed, 21 Nov 2007 09:24:41 +0900
> >> "Magnus Damm" <magnus.damm@gmail.com> wrote:
> >>
> >>> Hi there,
> >>>
> >>> On Nov 20, 2007 11:48 PM, <takasi-y@ops.dti.ne.jp> wrote:
> >>>> I found 6th arg for syscall is missing on SH4 linux-user emulation.
> >>>> This seems to be the cause of shared library mapping failure.
> >>>> I successfully run shared-lib'd binary, after applying following fix.
> >>> Hehe, I managed to create the exact same patch yesterday evening. So
> >>> this email is just to acknowledge this fix. Dynamically linked
> >>> binaries using uclibc-0.9.29 or glibc-2.3.6 both work well. Thank you.
> >>>
> >>> / magnus
> >>>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-11-21 22:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-20 14:48 [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall takasi-y
2007-11-21 0:24 ` Magnus Damm
2007-11-21 1:43 ` Tomoyoshi ASANO
2007-11-21 5:07 ` Tomoyoshi ASANO
2007-11-21 8:12 ` Magnus Damm
2007-11-21 9:50 ` Fabrice Bellard
2007-11-21 22:41 ` Tomoyoshi ASANO
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.