All of lore.kernel.org
 help / color / mirror / Atom feed
From: "André Braga" <meianoite@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] QEMU fails with different levels of compiler optimization
Date: Thu, 22 Jul 2004 13:02:51 -0300	[thread overview]
Message-ID: <2ad73a04072209021aed732c@mail.gmail.com> (raw)

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=-march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse
-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=pentium-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=-march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse
-finline-functions -funroll-loops -O2 -s

but only

HELPER_CFLAGS=-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?=blah
?

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é


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.


-- 
"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

             reply	other threads:[~2004-07-22 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-22 16:02 André Braga [this message]
     [not found] ` <20040723213844.GA18562@fefe.de>
2004-07-28  5:37   ` [Qemu-devel] Re: QEMU fails with different levels of compiler optimization André Braga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ad73a04072209021aed732c@mail.gmail.com \
    --to=meianoite@gmail.com \
    --cc=meianoite@meianoite.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.