From patchwork Sun Aug 28 12:09:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 111901 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B7816B6F70 for ; Sun, 28 Aug 2011 22:10:03 +1000 (EST) Received: from localhost ([::1]:37990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxeBX-0000Co-B3 for incoming@patchwork.ozlabs.org; Sun, 28 Aug 2011 08:09:55 -0400 Received: from eggs.gnu.org ([140.186.70.92]:43251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxeBR-0000Ch-S1 for qemu-devel@nongnu.org; Sun, 28 Aug 2011 08:09:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QxeBQ-0008LD-PM for qemu-devel@nongnu.org; Sun, 28 Aug 2011 08:09:49 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:46787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxeBQ-0008L8-DW for qemu-devel@nongnu.org; Sun, 28 Aug 2011 08:09:48 -0400 Received: from smtp04.web.de ( [172.20.0.225]) by fmmailgate02.web.de (Postfix) with ESMTP id 45F251A93B9E0; Sun, 28 Aug 2011 14:09:42 +0200 (CEST) Received: from [84.148.54.226] (helo=[10.0.1.1]) by smtp04.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.110 #2) id 1QxeBK-0005YK-00; Sun, 28 Aug 2011 14:09:42 +0200 Message-Id: From: =?ISO-8859-1?Q?Andreas_F=E4rber?= To: Aurelien Jarno , Paolo Bonzini Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 28 Aug 2011 14:09:40 +0200 X-Mailer: Apple Mail (2.936) X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX1/ox9r7msIx7yAESR+G2dmgPpdc0C63Sm10fmem TNnq/1hrzGM823FC+MaBPoyHnw2wz7Fa1gvu4sEgKqvQXjeEgs 4ht9YKRVV/mRzhiOm9jA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.227 Cc: Peter Maydell , Anthony Liguori , QEMU Developers , Alexander Graf Subject: [Qemu-devel] softfloat breaks cocoa.m X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hello, The unresolved softfloat uint* conversion business bites us again: This time, the previously working Cocoa frontend stopped compiling: In file included from /Users/andreas/QEMU/qemu/bswap.h:14, from /Users/andreas/QEMU/qemu/qemu-common.h:103, from /Users/andreas/QEMU/qemu/ui/cocoa.m:28: /Users/andreas/QEMU/qemu/fpu/softfloat.h:60: error: conflicting types for ‘uint16’ /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:68: error: previous declaration of ‘uint16’ was here make: *** [ui/cocoa.o] Error 1 Since commit cbbab9226da9572346837466a8770c117e7e65a2 (move unaligned memory access functions to bswap.h) softfloat.h is being #included in bswap.h, which gets pulled into cocoa.m through qemu-common.h. I thought Alex had set up a Darwin buildbot to catch such breakages... Any thoughts on how to proceed? My previous approach for Haiku, to replace non-standard uint16 with POSIX uint_fast16_t etc., was rejected to avoid system-dependent widths. I'd really like to get rid of the annoyingly conflicting naming though (int vs. long for 32, int vs. short for 16, ...). A fragile and ugly workaround is to suppress all softfloat usage within bswap.h (below). Andreas diff --git a/bswap.h b/bswap.h index f41bebe..ddef453 100644 --- a/bswap.h +++ b/bswap.h @@ -11,7 +11,9 @@ #include #else +#ifndef NO_SOFTFLOAT_H #include "softfloat.h" +#endif #ifdef CONFIG_BYTESWAP_H #include @@ -239,6 +241,7 @@ static inline uint32_t qemu_bswap_len(uint32_t value, int len) return bswap32(value) >> (32 - 8 * len); } +#ifndef NO_SOFTFLOAT_H typedef union { float32 f; uint32_t l; @@ -294,6 +297,7 @@ typedef union { } ll; #endif } CPU_QuadU; +#endif /* unaligned/endian-independent pointer access */ @@ -423,6 +427,7 @@ static inline void stq_le_p(void *ptr, uint64_t v) stl_le_p(p + 4, v >> 32); } +#ifndef NO_SOFTFLOAT_H /* float access */ static inline float32 ldfl_le_p(const void *ptr) @@ -461,6 +466,8 @@ static inline void stfq_le_p(void *ptr, float64 v) stl_le_p(ptr + 4, u.l.upper); } +#endif + #else static inline int lduw_le_p(const void *ptr) @@ -498,6 +505,7 @@ static inline void stq_le_p(void *ptr, uint64_t v) *(uint64_t *)ptr = v; } +#ifndef NO_SOFTFLOAT_H /* float access */ static inline float32 ldfl_le_p(const void *ptr) @@ -520,6 +528,7 @@ static inline void stfq_le_p(void *ptr, float64 v) *(float64 *)ptr = v; } #endif +#endif #if !defined(HOST_WORDS_BIGENDIAN) || defined(WORDS_ALIGNED) @@ -612,6 +621,7 @@ static inline void stq_be_p(void *ptr, uint64_t v) stl_be_p((uint8_t *)ptr + 4, v); } +#ifndef NO_SOFTFLOAT_H /* float access */ static inline float32 ldfl_be_p(const void *ptr) @@ -650,6 +660,8 @@ static inline void stfq_be_p(void *ptr, float64 v) stl_be_p((uint8_t *)ptr + 4, u.l.lower); } +#endif + #else static inline int lduw_be_p(const void *ptr) @@ -687,6 +699,7 @@ static inline void stq_be_p(void *ptr, uint64_t v) *(uint64_t *)ptr = v; } +#ifndef NO_SOFTFLOAT_H /* float access */ static inline float32 ldfl_be_p(const void *ptr) @@ -711,4 +724,6 @@ static inline void stfq_be_p(void *ptr, float64 v) #endif +#endif + #endif /* BSWAP_H */ diff --git a/ui/cocoa.m b/ui/cocoa.m index d9e4e3d..4bd0346 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -25,6 +25,7 @@ #import #include +#define NO_SOFTFLOAT_H #include "qemu-common.h" #include "console.h" #include "sysemu.h"