Bug 4164 - Cannot build qemu 1.0
Summary: Cannot build qemu 1.0
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-17 09:22 CET by Olav Vitters
Modified: 2012-03-02 11:22 CET (History)
4 users (show)

See Also:
Source RPM: gcc-4.6.2-1.mga2.src.rpm
CVE:
Status comment:


Attachments

Description Olav Vitters 2012-01-17 09:22:50 CET
Qemu 1.0 fails to build. I don't know any C, but still suspect this is a gcc/linker problem.

gcc -I/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/slirp -I. -I/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0 -I/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/fpu -I/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/linux-headers -I/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/tcg -I/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/tcg/i386  -fPIE -DPIE -m64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing   -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -I/usr/include/libpng15   -I/usr/include/spice-server -I/usr/include/pixman-1 -I/usr/include/spice-1   -I/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/libcacard -I/usr/include/nss -I/usr/include/nspr4   -I/usr/local/include   -DHAS_AUDIO -DHAS_AUDIO_CHOICE  -DTARGET_PHYS_ADDR_BITS=64 -I../linux-headers -I.. -I/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/target-ppc -DNEED_CPU_H -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -I/usr/include/p11-kit-1     -I/usr/include/libpng15   -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -MMD -MP -MT helper.o -MF ./helper.d -O2 -g  -c -o helper.o /home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/target-ppc/helper.c
i8259.o: In function `pic_read_irq':
/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/hw/i8259.c:240: undefined reference to `timer_acks'
/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/hw/i8259.c:241: undefined reference to `timer_ints_to_push'
collect2: ld returned 1 exit status
make[1]: *** [qemu-system-ppc] Error 1
make[1]: Leaving directory `/home/src/pkgs/qemu/BUILD/qemu-kvm-1.0/ppc-softmmu'
make: *** [subdir-ppc-softmmu] Error 2
make: *** Waiting for unfinished jobs....



The file hw/i8259.c:241 doesn't compile due to undefined references to variables timer_acks and timer_ints_to_push.

However, these are defined on lines 213+214:
> extern int time_drift_fix;
> extern int64_t timer_acks, timer_ints_to_push;


If you checkout qemu using mgarepo, then do a bm -p (to apply the patches), you can see above.

I'm guessing this is a GCC/linker problem. But I'm just guessing..

Fedora has loads of patches, see:
http://pkgs.fedoraproject.org/gitweb/?p=qemu.git;a=tree

I've tried the: Fix_save-restore_of_in-kernel_i8259.patch, but it only fixes another problem.
Comment 1 Manuel Hiebel 2012-01-17 18:20:58 CET
Tmb, any ideas ?

CC: (none) => tmb

Comment 2 Pascal Terjan 2012-01-18 02:26:41 CET
It looks like a qemu-kvm problem.
Fix_save-restore_of_in-kernel_i8259.patch addresses part of it (you would get a 3rd undefined symbol without the patch).
I'll try to look at it tomorrow.

CC: (none) => pterjan

Comment 3 Kamil Rytarowski 2012-01-18 07:57:04 CET
I think it's good to switch to qemu... kvm is merged into it,

CC: (none) => n54

Comment 4 Kamil Rytarowski 2012-01-18 08:07:54 CET
I've prepared a clean chroot environment, disabled the patch, switched to qemu (instead of qemu-kvm) and bm -l'ed it. And finally it WORKSFORME. The last thing is to adjust %files..
Comment 5 Olav Vitters 2012-01-18 09:09:06 CET
Fedora uses qemu-kvm and is able to compile it. My goal is to ensure gnome-boxes works. At the moment, it doesn't. Does it work with plain qemu? I'm not the qemu maintainer btw.
Comment 6 Pascal Terjan 2012-01-18 10:20:57 CET
Fedora does not build the ppc target
Manuel Hiebel 2012-01-18 12:14:10 CET

CC: (none) => misc

Comment 7 Michael Scherer 2012-01-21 14:40:32 CET
Qemu didn't merged kvm, or they would not have kept the project. So we will not switch.
Comment 8 Kamil Rytarowski 2012-01-21 16:31:54 CET
https://wiki.archlinux.org/index.php/QEMU#Difference_between_qemu_and_qemu-kvm

Upstream QEMU is a pure emulator, with no hardware acceleration. qemu versions < 0.15.0 do have initial KVM support when QEMU is started with the -enable-kvm parameter, but this implementation is still buggy and nowhere as complete as in qemu-kvm, as many functions still do not work. Starting with qemu version 0.15.0, the qemu-kvm tree has been fully integrated with the qemu tree, and there should not be any difference between qemu -enable-kvm and qemu-kvm. See the [QEMU changelog] for more details. 

Upstream QEMU is capable of emulating many different platforms (arm, i386, m68k, mips, ppc, sparc, x86_64, etc). On the other hand, you have qemu-kvm, which is qemu (i386 and x86_64 architecture support only) with KVM (kernel-based virtual machine) additions, allowing you to run virtual machines at close to native speed. qemu-kvm is the version you want if you have a CPU that supports hardware virtualization and you only need to run virtual machines for the i386 and x86_64 architectures (Linux, Windows, BSD, etc).
Comment 9 Kamil Rytarowski 2012-01-27 14:18:36 CET
Michael, what do you think? In my opinion there is no reason to stick to qemu-kvm.
Comment 10 Pascal Terjan 2012-01-27 14:21:25 CET
(In reply to comment #8)
> https://wiki.archlinux.org/index.php/QEMU#Difference_between_qemu_and_qemu-kvm
> 
> Upstream QEMU is capable of emulating many different platforms (arm, i386,
> m68k, mips, ppc, sparc, x86_64, etc). On the other hand, you have qemu-kvm,
> which is qemu (i386 and x86_64 architecture support only) with KVM
> (kernel-based virtual machine) additions,

This is not true, qemu-kvm also contains all the qemu code for other archs and we build them in our package.
Comment 11 Kamil Rytarowski 2012-02-02 12:36:31 CET
Pascal, and besides this?
Comment 12 Kamil Rytarowski 2012-02-15 03:42:29 CET
ping
Comment 13 Michael Scherer 2012-03-02 11:22:14 CET
Build is fixed

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.