spice backend fails to build on i386 with -Werror

Bug #928432 reported by Steve Langasek
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro QEMU
Fix Released
Undecided
Unassigned
qemu-linaro (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Because qemu-linaro 2012.01 is now based on a development release of qemu (1.0.50 instead of 1.0), the configure script turns on -Werror for building by default. This causes a problem for the recently-enabled spice support, because of some mismatched integer sizes on 32-bit systems.

  CC i386-softmmu/qxl.o
/home/vorlon/devel/linaro/qemu-linaro-fakeout/build-area/qemu-linaro-1.0.50-2012.01/hw/qxl.c: In function 'interface_release_resource':
/home/vorlon/devel/linaro/qemu-linaro-fakeout/build-area/qemu-linaro-1.0.50-2012.01/hw/qxl.c:631:46: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
/home/vorlon/devel/linaro/qemu-linaro-fakeout/build-area/qemu-linaro-1.0.50-2012.01/hw/qxl.c: In function 'interface_async_complete':
/home/vorlon/devel/linaro/qemu-linaro-fakeout/build-area/qemu-linaro-1.0.50-2012.01/hw/qxl.c:754:5: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'uint64_t' [-Werror=format]
/home/vorlon/devel/linaro/qemu-linaro-fakeout/build-area/qemu-linaro-1.0.50-2012.01/hw/qxl.c: In function 'qxl_phys2virt':
/home/vorlon/devel/linaro/qemu-linaro-fakeout/build-area/qemu-linaro-1.0.50-2012.01/hw/qxl.c:1021:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors

make[3]: *** [qxl.o] Error 1

This is a strange sort of bug; usually software gets size mismatches on 64-bit systems, not on 32-bit systems. In this case, spice upstream has defined a struct to use a 64-bit integer, so casting a 32-bit pointer in and out of it produces the above errors.

It may be an error that upstream is specifying uint64_t here instead of, say, intptr_t or unsigned long. So feel free to redirect this to spice upstream - since the spice-protocol package only produces headers and not a library, there are no ABI consequences to changing the type there AFAICS.

In the meantime I've worked around this failure in the Ubuntu package by passing --disable-werror for the spice build.

Tags: patch
Revision history for this message
Peter Maydell (pmaydell) wrote :

Last time I asked, Spice simply doesn't work/isn't supported on 32 bit hosts. Better to disable spice on the 32 bit builds I guess?

Revision history for this message
Rusty Russell (rusty-rustcorp) wrote :

Indeed, FAQ on wiki makes it clear. I don't know why Ubuntu even allows packages libspice-server-dev for i386, but I hit this too.

Revision history for this message
Steve Langasek (vorlon) wrote :

Ah; libspice-*-dev are architecture: all packages since they don't require rebuilding for different archs (they're just headers being shipped), so they're available on i386 even if not meant to be used. We can fix the package to not build-depend on them.

Revision history for this message
Peter Maydell (pmaydell) wrote :

Rusty: there's a typo there ("probel") but can you submit a version of that patch for upstream qemu to qemu-devel, please?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-linaro - 1.0.50-2012.01-0ubuntu3

---------------
qemu-linaro (1.0.50-2012.01-0ubuntu3) precise; urgency=low

  * Don't build the qemu-kvm-spice package on i386, spice is 64-bit-only.
    LP: #928432.
  * This means we don't have to disable -Werror on the spice build anymore.
 -- Steve Langasek <email address hidden> Tue, 07 Feb 2012 23:34:36 +0000

Changed in qemu-linaro (Ubuntu):
status: New → Fix Released
Revision history for this message
Peter Maydell (pmaydell) wrote :

Upstream says that apparently Spice does work on 32 bit hosts now (the FAQ is out of date). I've put the necessary compilation warning fixes into qemu-linaro pending them being committed upstream.

Steve: this means you'll want to unwind the 'don't build qemu-kvm-spice on i386' change in the packaging.

Changed in qemu-linaro:
status: New → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

reopening the Ubuntu task then, so we can revert this change in the next upload.

Changed in qemu-linaro (Ubuntu):
importance: Undecided → Medium
status: Fix Released → Triaged
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "configure patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Peter Maydell (pmaydell)
Changed in qemu-linaro:
status: Fix Committed → Fix Released
Steve Langasek (vorlon)
Changed in qemu-linaro (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

Building qemu-linaro 2012.03 on i386 still fails with the following errors:

/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c: In function 'qxl_spice_update_area':
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c:152:57: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c: In function 'qxl_spice_destroy_surface_wait':
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c:174:60: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c: In function 'qxl_spice_flush_surfaces_async':
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c:184:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c: In function 'qxl_spice_destroy_surfaces':
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c:216:17: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c: In function 'interface_async_complete_io':
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c:747:17: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'uint64_t' [-Werror=format]
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c: In function 'interface_async_complete':
/home/vorlon/devel/linaro/qemu-linaro/build-area/qemu-linaro-1.0.50-2012.03/hw/qxl.c:815:25: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Changed in qemu-linaro (Ubuntu):
status: Fix Committed → Triaged
Changed in qemu-linaro:
status: Fix Released → Triaged
Revision history for this message
Peter Maydell (pmaydell) wrote :

Oops. My test of this was on a 32 bit oneiric system, where configure now disables spice completely. Retested and reproduced on a precise-i386 chroot, and sent a patch upstream:
http://patchwork.ozlabs.org/patch/147207/

Revision history for this message
Peter Maydell (pmaydell) wrote :

This time for sure!

Changed in qemu-linaro:
milestone: none → 2012.04
status: Triaged → Fix Committed
Peter Maydell (pmaydell)
Changed in qemu-linaro:
status: Fix Committed → Fix Released
Revision history for this message
Jeremy Bícha (jbicha) wrote :

I believe this has been fixed for Ubuntu 13.04 "Raring":

https://launchpad.net/ubuntu/+source/qemu-linaro/1.2.0-2012.09-0ubuntu2

Changed in qemu-linaro (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.