From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47177 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJA3d-0003cK-Qu for qemu-devel@nongnu.org; Mon, 31 May 2010 14:49:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJ9yr-0003UY-Ba for qemu-devel@nongnu.org; Mon, 31 May 2010 14:44:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49929 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJ9yr-0003UQ-6e for qemu-devel@nongnu.org; Mon, 31 May 2010 14:44:57 -0400 Message-ID: <4C0403A7.9010106@suse.de> Date: Mon, 31 May 2010 20:44:55 +0200 From: Alexander Graf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Fix leul_to_cpu on big endian hosts References: <1273592297-18370-1-git-send-email-agraf@suse.de> <20100531184345.GU4621@ohm.aurel32.net> In-Reply-To: <20100531184345.GU4621@ohm.aurel32.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: Marcelo Tosatti , qemu-devel@nongnu.org Aurelien Jarno wrote: > On Tue, May 11, 2010 at 05:38:17PM +0200, Alexander Graf wrote: > =20 >> Commit 213acd2e introduced leul_to_cpu with a special code path for bi= g endian >> hosts. Unfortunately that code used preprocessor magic that didn't wor= k. >> >> This patch replaces the explicit ##s by glue() which is proven to work= reliably, >> enabling me to compile qemu on ppc again. >> >> Signed-off-by: Alexander Graf >> --- >> bswap.h | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/bswap.h b/bswap.h >> index 956f3fa..20caae6 100644 >> --- a/bswap.h >> +++ b/bswap.h >> @@ -205,7 +205,7 @@ static inline void cpu_to_be32wu(uint32_t *p, uint= 32_t v) >> =20 >> #ifdef HOST_WORDS_BIGENDIAN >> #define cpu_to_32wu cpu_to_be32wu >> -#define leul_to_cpu(v) le ## HOST_LONG_BITS ## _to_cpu(v) >> +#define leul_to_cpu(v) glue(glue(le,HOST_LONG_BITS),_to_cpu)(v) >> #else >> #define cpu_to_32wu cpu_to_le32wu >> #define leul_to_cpu(v) (v) >> =20 > > While the patch looks correct, I am not able to reproduce the issue. Do > you have more details about it? > =20 When building on a KVM capable PPC host (or S390 for that matter), I get the following: cc1: warnings being treated as errors /home/agraf/release/qemu/kvm-all.c: In function =E2=80=98kvm_get_dirty_pages_log_range=E2=80=99: /home/agraf/release/qemu/kvm-all.c:305: error: implicit declaration of function =E2=80=98leHOST_LONG_BITS_to_cpu=E2=80=99 make[1]: *** [kvm-all.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [subdir-ppc64-softmmu] Error 2 Alex