From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqN1i-0006wt-Nv for qemu-devel@nongnu.org; Thu, 07 May 2015 10:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqN1d-0003cd-3m for qemu-devel@nongnu.org; Thu, 07 May 2015 10:43:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqN1c-0003cY-RH for qemu-devel@nongnu.org; Thu, 07 May 2015 10:43:45 -0400 Message-ID: <554B7A1D.1060807@redhat.com> Date: Thu, 07 May 2015 08:43:41 -0600 From: Eric Blake MIME-Version: 1.0 References: <1430999444-24315-1-git-send-email-quintela@redhat.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kmi0U65kOmBbLXU9EtTepDLtpe7wQg2dK" Subject: Re: [Qemu-devel] [PULL 00/16] Migration pull request (v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Juan Quintela Cc: Paolo Bonzini , QEMU Developers This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kmi0U65kOmBbLXU9EtTepDLtpe7wQg2dK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/07/2015 06:45 AM, Peter Maydell wrote: > Fails to build on win32: >=20 > LINK arm-softmmu/qemu-system-arm.exe > arch_init.o: In function `do_compress_ram_page': > /home/petmay01/linaro/qemu-for-merges/arch_init.c:879: undefined > reference to `___sync_fetch_and_add_8' > collect2: ld returned 1 exit status >=20 > It's not valid to try to do atomic operations on a type > that's larger than the native pointer type. (This will also > cause compile issues on ppc32.) Unfortunately we don't > currently have a way to make this a compile failure on > normal 32-bit x86 setups... Right now, patch 8/16 is the culprit: + atomic_inc(&acct_info.norm_pages); which expands to: include/qemu/atomic.h:#define atomic_inc(ptr) ((void) __sync_fetch_and_add(ptr, 1)) I wonder if include/qemu/atomic.h could enhance the #define wrappers to add no-op compile-time checking, something like (untested): #define atomic_add(ptr, n) do { \ QEMU_BUILD_BUG_ON(sizeof(ptr) > sizeof(void*)); \ __sync_fetch_and_add(ptr, 1); \ } while (0) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --kmi0U65kOmBbLXU9EtTepDLtpe7wQg2dK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVS3odAAoJEKeha0olJ0Nqp6kH/Rn1vRcXtWCapYjAze2ywR/C btCqJwnTVfD3ngvBZ1AzXfaZtzsLfjHzqvsTAAdb4Ufe1Zo8tlN4Rejq2udNZdF4 tvGTCjEqWb/kgO5O90klC6TzYGUpG9TCZW+yWEh+n2Gs4fCNuKhoIR6snE5FHvFu 4vfSSxXOEnS7iykL2TgLCTaFaDOuPf/9WS1NQ7DiN8uT0XRd+VzCFB8iAqm3V/+q l7eConmlCCHDpaEVBmZSzLpH3i5+oZkyVsgkDBZ3vZ6iMmOrj9mvmeHHqLfu7oLp XN8SKEi3pIZQbpIWAQoocemL8PetLEbDSxqPJOKZN+yiIsf1keaYFBz4QSbI7PM= =xa2V -----END PGP SIGNATURE----- --kmi0U65kOmBbLXU9EtTepDLtpe7wQg2dK--