qemu-0.7.0 Solaris Host patch (Real)
Quoted 32 lines
gcc-3.4.2 -Wall -O2 -g -fno-strict-aliasing -m32 -ffixed-g1 -ffixed-g2
- -ffixed-g3 -ffixed-g6 -fno-delayed-branch -ffixed-i0 -fno-reorder-blocks
- -fno-optimize-sibling-calls -I. -I/home/nardmann/qemu-0.7.0/target-i386
- -I/home/nardmann/qemu-0.7.0 -I/opt/SUNWspro/prod/include/cc -D_GNU_SOURCE
- -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/home/nardmann/qemu-0.7.0/fpu
- -I/home/nardmann/qemu-0.7.0/slirp -c -o
op.o/home/nardmann/qemu-0.7.0/target-i386/op.c
In file included from/home/nardmann/qemu-0.7.0/fpu/softfloat-native.h:7,from /home/nardmann/qemu-0.7.0/fpu/softfloat.h:394, from /home/nardmann/qemu-0.7.0/target-i386/cpu.h:41, from /home/nardmann/qemu-0.7.0/target-i386/exec.h:143, from /home/nardmann/qemu-0.7.0/target-i386/op.c:22: /opt/SUNWspro/prod/include/cc/fenv.h:8: warning: ignoring #pragma ident In file included from /home/nardmann/qemu-0.7.0/fpu/softfloat.h:394, from /home/nardmann/qemu-0.7.0/target-i386/cpu.h:41, from /home/nardmann/qemu-0.7.0/target-i386/exec.h:143, from /home/nardmann/qemu-0.7.0/target-i386/op.c:22:
/home/nardmann/qemu-0.7.0/fpu/softfloat-native.h: In function `float32_abs':/home/nardmann/qemu-0.7.0/fpu/softfloat-native.h:164: warning: implicit declaration of function `fabsf'
In file included from/home/nardmann/qemu-0.7.0/target-i386/op.c:724:/home/nardmann/qemu-0.7.0/target-i386/ops_template.h: In function `op_jb_subb':/home/nardmann/qemu-0.7.0/target-i386/ops_template.h:278: warning: implicit declaration of function `GOTO_LABEL_PARAM'
../dyngen -oop.hop.o
dyngen: Found bogus save at the start ofop_pavgw_xmm
Quoted 2 lines
I found that
GOTO_LABEL_PARAMist not defined for sparc indyngen-exec.h; any reason for this?
I've fixed the 'bogus save' issue (and another sparc problem with incorrect C syntax generated by dyngen) with this patch:
Index: dyngen.c
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen.c,v
retrieving revision 1.40
dyngen.c 2 May 2005 18:29:08 -0000 renamed from dyngen.c 27 Apr 2005 19:55:58 -0000 1.40 +4 -2
@@ -1196,7 +1196,7 @@ } else { #ifdef HOST_SPARC if (sym_name[0] == '.') - snprintf(name, sizeof(name), + snprintf(name, name_size, "(long)(&__dot_%s)", sym_name + 1); else
@@ -1451,7 +1451,9 @@ if ((start_insn & ~0x1fff) == 0x9de3a000) { p_start += 0x4; start_offset += 0x4; - if ((int)(start_insn | ~0x1fff) < -128) + // if ((int)(start_insn | ~0x1fff) < -128) + // Why -128? op_pavgb_xmm adjusts the stack by -0x110 == -272 + if ((int)(start_insn | ~0x1fff) < -272) error("Found bogus save at the start of %s", name); if (end_insn1 != 0x81c7e008 || end_insn2 != 0x81e80000) error("ret; restore; not found at end of %s", name);
The missing GOTO_LABEL_PARAM macro needs a patch like this:
Index: dyngen-exec.h
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen-exec.h,v
retrieving revision 1.25
dyngen-exec.h 2 May 2005 18:29:07 -0000 renamed from dyngen-exec.h 24 Apr 2005 18:01:56 -0000 1.25 +2 -0
@@ -230,6 +237,8 @@ #ifdef __sparc__ #define EXIT_TB() asm volatile ("jmpl %i0 + 8, %g0\n" \ "nop") +#define GOTO_LABEL_PARAM(n) asm volatile ( \ + "set " ASM_NAME(__op_gen_label) #n ", %g1; jmp %g1; nop") #endif #ifdef __arm__ #define EXIT_TB() asm volatile ("b exec_loop")
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Okay, I now have applied all given patches to the source tree. But I still have problems linking qemu. Here is the linker error message:
gcc -o qemu vl.o osdep.o block.o readline.o monitor.o pci.o console.o block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o audio.o noaudio.o wavaudio.o sdlaudio.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o cirrus_vga.omixeng.o apic.o parallel.o gdbstub.o sdl.o slirp/cksum.o slirp/if.o slirp/ip_icmp.o slirp/ip_input.o slirp/ip_output.o slirp/slirp.o slirp/mbuf.o slirp/misc.o slirp/sbuf.o slirp/socket.o slirp/tcp_input.o slirp/tcp_output.o slirp/tcp_subr.o slirp/tcp_timer.o slirp/udp.o slirp/bootp.o slirp/debug.o slirp/tftp.olibqemu.a -lm -lz -lsocket -lnsl
- -lresolv -L/opt/sfw/lib -R/opt/sfw/lib -lSDL -lpthread -lposix4
Undefined first referenced
symbol in file fesetround libqemu.a(softfloat-native.o) lrintf libqemu.a(softfloat-native.o) llrint libqemu.a(softfloat-native.o) rintf libqemu.a(softfloat-native.o) lrint libqemu.a(softfloat-native.o) remainderf libqemu.a(softfloat-native.o) sqrtf libqemu.a(softfloat-native.o) llrintf libqemu.a(softfloat-native.o)
ld: fatal: Symbol referencing errors. No output written to qemu
collect2: ld returned 1 exit status
gmake[1]: *** [qemu] Error 1
Okay, fesetround can be resolved by adding '-L/opt/SUNWspro/lib -lm9x' but what about the other symbols?
Another thing:
during compilation I get a lot of warnings about fabs which is declared inside /opt/SUNWspro/prod/cc/include/sunmath.h:
/home/nardmann/qemu-0.7.0/fpu/softfloat-native.h:171: warning: implicit declaration of function `fabsf'
BTW: yes, I am using Solaris 9.
Quoted 88 lines · Juergen Keil
Quoted 31 lines
gcc-3.4.2 -Wall -O2 -g -fno-strict-aliasing -m32 -ffixed-g1 -ffixed-g2
- -ffixed-g3 -ffixed-g6 -fno-delayed-branch -ffixed-i0(quoted diff) +0
-5-fno-reorder-blocks - -fno-optimize-sibling-calls -I. -I/home/nardmann/qemu-0.7.0/target-i386 - -I/home/nardmann/qemu-0.7.0 -I/opt/SUNWspro/prod/include/cc -D_GNU_SOURCE - -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/home/nardmann/qemu-0.7.0/fpu - -I/home/nardmann/qemu-0.7.0/slirp -c -oop.o
/home/nardmann/qemu-0.7.0/target-i386/op.c
In file included from/home/nardmann/qemu-0.7.0/fpu/softfloat-native.h:7,from /home/nardmann/qemu-0.7.0/fpu/softfloat.h:394, from /home/nardmann/qemu-0.7.0/target-i386/cpu.h:41, from /home/nardmann/qemu-0.7.0/target-i386/exec.h:143, from /home/nardmann/qemu-0.7.0/target-i386/op.c:22: /opt/SUNWspro/prod/include/cc/fenv.h:8: warning: ignoring #pragma ident In file included from /home/nardmann/qemu-0.7.0/fpu/softfloat.h:394, from /home/nardmann/qemu-0.7.0/target-i386/cpu.h:41, from /home/nardmann/qemu-0.7.0/target-i386/exec.h:143, from /home/nardmann/qemu-0.7.0/target-i386/op.c:22:
/home/nardmann/qemu-0.7.0/fpu/softfloat-native.h: In function `float32_abs':/home/nardmann/qemu-0.7.0/fpu/softfloat-native.h:164:
warning: implicit declaration of function `fabsf'
In file included from/home/nardmann/qemu-0.7.0/target-i386/op.c:724:/home/nardmann/qemu-0.7.0/target-i386/ops_template.h: In function `op_jb_subb':/home/nardmann/qemu-0.7.0/target-i386/ops_template.h:278: warning:
implicit declaration of function `GOTO_LABEL_PARAM' ../dyngen -oop.hop.o
dyngen: Found bogus save at the start ofop_pavgw_xmmQuoted 2 lines
I found that
GOTO_LABEL_PARAMist not defined for sparc indyngen-exec.h; any reason for this?I've fixed the 'bogus save' issue (and another sparc problem with incorrect C syntax generated by dyngen) with this patch:
Index:
dyngen.c
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen.c,v
retrieving revision 1.40
diff -u -B -r1.40dyngen.cdyngen.c 2 May 2005 18:29:08 -0000 renamed from dyngen.c 27 Apr 2005 19:55:58 -0000 1.40 +4
-2@@ -1196,7 +1196,7 @@ } else { #ifdef HOST_SPARC if (sym_name[0] == '.') - snprintf(name, sizeof(name), + snprintf(name, name_size, "(long)(&__dot_%s)", sym_name + 1); else@@ -1451,7 +1451,9 @@ if ((start_insn & ~0x1fff) == 0x9de3a000) { p_start += 0x4; start_offset += 0x4; - if ((int)(start_insn | ~0x1fff) < -128) + // if ((int)(start_insn | ~0x1fff) < -128) + // Why -128? op_pavgb_xmm adjusts the stack by -0x110 == -272 + if ((int)(start_insn | ~0x1fff) < -272) error("Found bogus save at the start of %s", name); if (end_insn1 != 0x81c7e008 || end_insn2 != 0x81e80000) error("ret; restore; not found at end of %s", name);The missing
GOTO_LABEL_PARAMmacro needs a patch like this:Index:
dyngen-exec.h
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen-exec.h,v
retrieving revision 1.25
diff -u -B -r1.25dyngen-exec.hdyngen-exec.h 2 May 2005 18:29:07 -0000 renamed from dyngen-exec.h 24 Apr 2005 18:01:56 -0000 1.25 +2
-0@@ -230,6 +237,8 @@ #ifdef __sparc__ #define EXIT_TB() asm volatile ("jmpl %i0 + 8, %g0\n" \ "nop") +#define GOTO_LABEL_PARAM(n) asm volatile ( \ + "set " ASM_NAME(__op_gen_label) #n ", %g1; jmp %g1; nop") #endif #ifdef __arm__ #define EXIT_TB() asm volatile ("b exec_loop")
Quoted 4 lines
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
- --
Heiko Nardmann (Dipl.-Ing. Technische Informatik)
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de), Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax : +49 271 48950-50
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFCd3hXpm53PRScYygRAlJ2AKDOBYPKSzCtSsMFZRdFly6xOqG/qQCeKXV1 H7woQPoygPfc/m5buJyvBiM=
=E9ls
-----END PGP SIGNATURE-----