From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6ioK-0002Ju-PL for qemu-devel@nongnu.org; Wed, 08 Feb 2006 01:28:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6ioJ-0002JB-Rm for qemu-devel@nongnu.org; Wed, 08 Feb 2006 01:28:16 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6ioJ-0002J2-LZ for qemu-devel@nongnu.org; Wed, 08 Feb 2006 01:28:15 -0500 Received: from [69.9.180.118] (helo=mail.squishy.cc) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6irZ-0003Fx-EJ for qemu-devel@nongnu.org; Wed, 08 Feb 2006 01:31:37 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.squishy.cc (Postfix) with ESMTP id 5019D58D0004 for ; Wed, 8 Feb 2006 01:28:25 -0500 (EST) Date: Tue, 7 Feb 2006 22:28:15 -0800 (PST) From: Jurij Smakov Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY="-1463804416-644938178-1138341911=:4366" Subject: [Qemu-devel] Some patches for qemu on sparc Reply-To: jurij@wooyd.org, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463804416-644938178-1138341911=:4366 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed Hi, I'm trying to make qemu build on linux-sparc (Debian port). I've made some progress and sent the message included below to Debian qemu maintainers. They are probably too busy with other stuff, so I hope I can get some feedback from you. Please CC the replies to me since I'm not subscribed to this list. Thanks, Jurij Smakov jurij@wooyd.org Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC ---------- Forwarded message ---------- Date: Thu, 26 Jan 2006 22:05:11 -0800 (PST) From: Jurij Smakov To: 317145@bugs.debian.org, 317145-submitter@bugs.debian.org Cc: control@bugs.debian.org Subject: Some patches for qemu on sparc found 317145 0.8.0-1 thanks Hi, I've started fiddling with qemu 0.8.0-1 on sparc in attempt to make it build. That's the issues I've encountered so far: * Current build failure of qemu on sparc buildd was, in part, the buildd's fault. Due to a misconfiguration it was operating in 64-bit mode, which should not normally happen. Thanks for Ryan Murray for fixing it in no time. * Nevertheless, even in intended 32-bit mode it still fails to build with the messages: gcc-3.4 -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/jurij/tmp/qemu-0.8.0/./target-i386 -I/home/jurij/tmp/qemu-0.8.0/. -I/home/jurij/tmp/qemu-0.8.0/./linux-user -I/home/jurij/tmp/qemu-0.8.0/./linux-user/i386 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/home/jurij/tmp/qemu-0.8.0/./fpu -DHAS_AUDIO -I/home/jurij/tmp/qemu-0.8.0/./slirp -c -o op.o /home/jurij/tmp/qemu-0.8.0/./target-i386/op.c In file included from /home/jurij/tmp/qemu-0.8.0/./target-i386/op.c:736: /home/jurij/tmp/qemu-0.8.0/./target-i386/ops_template.h: In function `op_jb_subb': /home/jurij/tmp/qemu-0.8.0/./target-i386/ops_template.h:278: warning: implicit declaration of function `GOTO_LABEL_PARAM' ../dyngen -o op.h op.o dyngen: Found bogus save at the start of op_pavgb_xmm make[2]: *** [op.h] Error 1 make[2]: Leaving directory `/home/jurij/tmp/qemu-0.8.0/i386-user' make[1]: *** [all] Error 1 make[1]: Leaving directory `/home/jurij/tmp/qemu-0.8.0' make: *** [debian/stamp-makefile-build] Error 2 After some googling I was able to find fixes for this problem, mentioned on the upstream mailing list [0]. For some reason they did not get included in the current version. * After applying the patches mentioned there, it proceeds a bit further, to fail again with the messages: gcc-3.4 -g -m32 -Wl,-T,/home/jurij/tmp/qemu-0.8.0/./sparc.ld -static -o qemu-i386 elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o vm86.o libqemu.a gdbstub.o -lm -lrt /usr/bin/ld: BFD 2.16.91 20060118 Debian GNU/Linux assertion fail ../../bfd/elf.c:3864 /usr/bin/ld: qemu-i386: Not enough room for program headers (allocated 5, need 6) /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status make[2]: *** [qemu-i386] Error 1 make[2]: Leaving directory `/home/jurij/tmp/qemu-0.8.0/i386-user' make[1]: *** [all] Error 1 make[1]: Leaving directory `/home/jurij/tmp/qemu-0.8.0' make: *** [debian/stamp-makefile-build] Error 2 There appears to be no good solution for that kind of problem around. AFAICT, it's not binutils bug, but rather the problem with the linker script sparc.ld. It should be fixed somehow, but nobody appears to know how, so people were just replacing SIZEOF_HEADERS in the linker script with some reasonably big number [1] :-). Replacing it with 0x400 did fix the issue. * That brought me further again, but still no cookie. Now it fails while building the arm target: gcc-3.4 -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/jurij/tmp/qemu-0.8.0/./target-arm -I/home/jurij/tmp/qemu-0.8.0/. -I/home/jurij/tmp/qemu-0.8.0/./linux-user -I/home/jurij/tmp/qemu-0.8.0/./linux-user/arm -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/home/jurij/tmp/qemu-0.8.0/./fpu -I/home/jurij/tmp/qemu-0.8.0/./slirp -c -o op.o /home/jurij/tmp/qemu-0.8.0/./target-arm/op.c ../dyngen -o op.h op.o dyngen: No save at the beginning of op_movl_T0_r0 make[2]: *** [op.h] Error 1 make[2]: Leaving directory `/home/jurij/tmp/qemu-0.8.0/arm-user' make[1]: *** [all] Error 1 make[1]: Leaving directory `/home/jurij/tmp/qemu-0.8.0' make: *** [debian/stamp-makefile-build] Error 2 Function op_movl_T0_r0 (and others) in arm-user/op.o indeed does not contain a save in the beginning. That's how it looks according to objdump -d arm-user/op.o: 00000000 : 0: c2 01 80 00 ld [ %g6 ], %g1 4: 81 c3 e0 08 retl 8: 01 00 00 00 nop I have no idea how to fix that one, nor was I able to find anything relevant on the net (even though I did not look too hard). If you (or upstream) have any ideas regarding this, please let me know. Attached patch implements all the changes which got me that far. [0] http://lists.gnu.org/archive/html/qemu-devel/2005-05/msg00039.html [1] http://bugs.gentoo.org/show_bug.cgi?id=51078 comment #13 Best regards, Jurij Smakov jurij@wooyd.org Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC ---1463804416-644938178-1138341911=:4366 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=qemu.patch Content-Transfer-Encoding: BASE64 Content-Description: Content-Disposition: attachment; filename=qemu.patch ZGlmZiAtYXVyIGEvZHluZ2VuLmMgYi9keW5nZW4uYw0KLS0tIGEvZHluZ2Vu LmMJMjAwNS0xMi0xOSAxNDo1MTo1My4wMDAwMDAwMDAgLTA4MDANCisrKyBi L2R5bmdlbi5jCTIwMDYtMDEtMjYgMjE6MzA6MjguMTA5Nzc2NjY0IC0wODAw DQpAQCAtMTE5Niw3ICsxMTk2LDcgQEANCiAgICAgfSBlbHNlIHsNCiAjaWZk ZWYgSE9TVF9TUEFSQw0KICAgICAgICAgaWYgKHN5bV9uYW1lWzBdID09ICcu JykNCi0gICAgICAgICAgICBzbnByaW50ZihuYW1lLCBzaXplb2YobmFtZSks DQorICAgICAgICAgICAgc25wcmludGYobmFtZSwgbmFtZV9zaXplLA0KICAg ICAgICAgICAgICAgICAgICAgICIobG9uZykoJl9fZG90XyVzKSIsDQogICAg ICAgICAgICAgICAgICAgICAgc3ltX25hbWUgKyAxKTsNCiAgICAgICAgIGVs c2UNCkBAIC0xNDUxLDcgKzE0NTEsOSBAQA0KICAgICAgICAgaWYgKChzdGFy dF9pbn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gICAgICAgICJub3AiKQ0KKyNkZWZp bmUgICAgICAgIEdPVE9fTEFCRUxfUEFSQU0obikgYXNtIHZvbGF0aWxlICgg XA0KKyAgICAgICAgICAgICAgICJzZXQgIiBBU01fTkFNRShfX29wX2dlbl9s YWJlbCkgI24gIiwgJWcxOyBqbXAgJWcxOyBub3AiKQ0KICNlbmRpZg0KICNp ZmRlZiBfX2FybV9fDQogI2RlZmluZSBFWElUX1RCKCkgYXNtIHZvbGF0aWxl ICgiYiBleGVjX2xvb3AiKQ0KT25seSBpbiBiOiBkeW5nZW4tZXhlYy5oLm9y aWcNCmRpZmYgLWF1ciBhL3NwYXJjLmxkIGIvc3BhcmMubGQNCi0tLSBhL3Nw YXJjLmxkCTIwMDUtMTItMTkgMTQ6NTE6NTMuMDAwMDAwMDAwIC0wODAwDQor KysgYi9zcGFyYy5sZAkyMDA2LTAxLTI2IDIxOjMwOjQ1LjkzOTA2NjIwMCAt MDgwMA0KQEAgLTYsNyArNiw3IEBADQogU0VDVElPTlMNCiB7DQogICAvKiBS ZWFkLW9ubHkgc2VjdGlvbnMsIG1lcmdlZCBpbnRvIHRleHQgc2VnbWVudDog Ki8NCi0gIC4gPSAweDYwMDAwMDAwICsgU0laRU9GX0hFQURFUlM7DQorICAu ID0gMHg2MDAwMDAwMCArIDB4NDAwOw0KICAgLmludGVycCAgICAgOiB7ICoo LmludGVycCkgCX0NCiAgIC5oYXNoICAgICAgICAgIDogeyAqKC5oYXNoKQkJ fQ0KICAgLmR5bnN5bSAgICAgICAgOiB7ICooLmR5bnN5bSkJCX0NCg== ---1463804416-644938178-1138341911=:4366--