From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYfiu-0000IU-UA for qemu-devel@nongnu.org; Sun, 27 May 2012 11:49:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYfit-0003e8-1v for qemu-devel@nongnu.org; Sun, 27 May 2012 11:49:40 -0400 Message-ID: <4FC24D07.2030006@suse.de> Date: Sun, 27 May 2012 17:49:27 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1338133059-43484-1-git-send-email-andreas.faerber@web.de> In-Reply-To: <1338133059-43484-1-git-send-email-andreas.faerber@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.1] arch_init: Fix AltiVec build on Darwin/ppc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-ppc , Eduardo Habkost , Alexander Graf Am 27.05.2012 17:37, schrieb Andreas F=C3=A4rber: > Commit f29a56147b66845914d0a645bf9b4c5bb9a6af57 (implement > -no-user-config command-line option (v3)) introduced uses of bool > in arch_init.c. Shortly before that usage is support code for > AltiVec (conditional to __ALTIVEC__). >=20 > GCC's altivec.h may in a !__APPLE_ALTIVEC__ code path redefine bool, > leading to type mismatches. altivec.h recommends to #undef for C++ > compatibility, but doing so on C leads to bool remaining undefined. "in C" - please fix when applying. Thanks, Andreas > Fix by redefining bool to _Bool as mandated for stdbool.h by POSIX. >=20 > Signed-off-by: Andreas F=C3=A4rber > Cc: Eduardo Habkost > Cc: Paolo Bonzini > Cc: Alexander Graf > Cc: qemu-ppc P.S. No such errors with gcc (SUSE Linux) 4.6.3, even with --extra-cflags=3D"-maltivec", so I'm guessing __bool differs. > --- > arch_init.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) >=20 > diff --git a/arch_init.c b/arch_init.c > index 988adca..a9e8b74 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -100,6 +100,10 @@ const uint32_t arch_type =3D QEMU_ARCH; > #define VECTYPE vector unsigned char > #define SPLAT(p) vec_splat(vec_ld(0, p), 0) > #define ALL_EQ(v1, v2) vec_all_eq(v1, v2) > +/* altivec.h may redefine the bool macro as vector type. > + * Reset it to POSIX semantics. */ > +#undef bool > +#define bool _Bool > #elif defined __SSE2__ > #include > #define VECTYPE __m128i --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg