From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bng4t-0000js-Vg for qemu-devel@nongnu.org; Thu, 22 Jul 2004 12:05:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bng4s-0000jZ-Rk for qemu-devel@nongnu.org; Thu, 22 Jul 2004 12:05:51 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bng4s-0000jT-MF for qemu-devel@nongnu.org; Thu, 22 Jul 2004 12:05:50 -0400 Received: from [64.233.170.206] (helo=mproxy.gmail.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1Bng1z-000392-FI for qemu-devel@nongnu.org; Thu, 22 Jul 2004 12:02:51 -0400 Received: by mproxy.gmail.com with SMTP id d78so91181rnf for ; Thu, 22 Jul 2004 09:02:51 -0700 (PDT) Message-ID: <2ad73a04072209021aed732c@mail.gmail.com> Date: Thu, 22 Jul 2004 13:02:51 -0300 From: =?ISO-8859-1?Q?Andr=E9_Braga?= Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] QEMU fails with different levels of compiler optimization Reply-To: meianoite@meianoite.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 First and foremost, I'd like to congratulate Fabrice Bellard and everyone involved on this project. I've never been so excited with an opensource emulation project like this, so I decided I just *had* to jump in :) Following other's experiments, I tried to build QEMU with different compiler switches to see if I could get a more optimized binary. I'm doing this build on mingw on a XP host now, but I have access to Linux, FreeBSD on the Intel side and Mac OS X on the Apple side (a 1st generation iMac, not a speed demon), and I might be able to fiddle with a PA-RISC64 HP-UX machine. Anyway. So far, my goal is to produce a working binary with those switches= : CFLAGS=3D-march=3Dathlon-xp -mmmx -m3dnow -msse -mfpmath=3Dsse -finline-functions -funroll-loops -O2 -s which are the same I used to build SDL (ASM blitters, 1.2.7. Had to fix a few declarations on SDL_yuv_mmx.c because they totally forgot about NASM, it seems). (I'm not doing -O3 by itself because of register constraints on the x86, and the -s switch is superfluous, but I like to spare my time and not run strip every other build. Besides, code that fits the cache is nice. :)) With these switches, I can *almost* build a working binary. After manually compiling helper.c changing the flags to "-march=3Dpentium-mmx -mmmx -finline-functions -funroll-loops -O2 -s" , I can actually load a knoppix-based image up to the graphical LILO loader. As it gets to loading the kernel, it fails with exception code 0xC000001E, which is "STATUS_INVALID_LOCK_SEQUENCE". It might be something with the loop unrolling or the inlining of functions, but I'd like to have more guidance on where/how to debug it. I have GDB available but I have no clue on how to use it in a meaningful way to this project (as I always steptrace my own programs...). BTW, the build works flawlessly if I run everything with CFLAGS=3D-march=3Dathlon-xp -mmmx -m3dnow -msse -mfpmath=3Dsse -finline-functions -funroll-loops -O2 -s but only HELPER_CFLAGS=3D-Wall -fno-strict-aliasing -O2 -s -fomit-frame-pointer And surely enough, I hand-editted the makefiles, since they don't seem to respect my environment... Maybe because CFLAGS is set again and not re-declared as CFLAGS?=3Dblah ? Sice there was already a bug found on GCC exactly on this helper.c file, I'll not be surprised if this is but another bug, but I'd give they a little more credit than that and come to this list first. I might try to build it again with the flags I wanted first and trace the execution up to the point where it fails, but, still, I'd appreciate some instructions. GCC reports itself as 'gcc version 3.2.3 (mingw special 20030504-1)'. It's the stock one found on mingw site. I'm running the latest CVS sources, also. Thanks a lot! Andr=E9 PS: I tried to build it with the prerelease GCC3.4 mingw build by bitWalk (found on http://www63.tok2.com/home/bitwalk/download.html), but neither SDL nor QEMU build correctly on their toolchain (so I'd chalk it up to compiler bugs and/or conflicting versions of the toolchain). I also tried the thisiscool-gcc 3.5 build (www.thisiscool.com/gcc_mingw.htm), and again it failed. I haven't tried the thisiscool-gcc 3.4 toolchain yet. PPS: Nework ain't working, but this seems to be a common problem under XP host, right? I can ping the host's address, but nothing else works (no DNS, no CIFS). And sound is also not working, but I haven't yet applied the patches found on http://www.h7.dion.ne.jp/~qemu-win/ , so this might be expected. --=20 "Structure is nothing if it is all you've got. Skeletons spook people if they try to walk around on their own; I really wonder why XML does not" -Erik Naggum