I wanted to build qemu-0.8.1 and the latest kqemu kernel module, but I haven’t yet figured how the heck to reconcile these facts:
- When you run ./configure on a Dapper system, QEMU complains that gcc4 is not recommended. I can disable that check and build with gcc4, but then the build fails with a super gnarly error about register spilling. So it seems that I have to use gcc3.
- The kqemu kernel module needs to be built to match your kernel and thus must be built with the same compiler that the kernel was built with.
- My kernel was built with gcc4:
marc@tbird:~/qemu-0.8.1$ cat /proc/version Linux version 2.6.15-25-686 (buildd@terranova) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 SMP PREEMPT Wed Jun 14 11:34:19 UTC 2006
As a result, I can build qemu and the kernel module with gcc3, but I can’t load the kernel module:
marc@tbird:~/qemu-0.8.1/kqemu-1.3.0pre9$ sudo modprobe kqemu FATAL: Error inserting kqemu (/lib/modules/2.6.15-25-686/misc/kqemu.ko): Invalid module format
Any ideas on how to make this work?
Update: Chimpoid has the answer below! Just build qemu with gcc3 and the kqemu module with gcc4. Works great.