From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MPFaV-0000pO-7N for qemu-devel@nongnu.org; Fri, 10 Jul 2009 08:52:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MPFaQ-0000hX-1z for qemu-devel@nongnu.org; Fri, 10 Jul 2009 08:52:26 -0400 Received: from [199.232.76.173] (port=59854 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPFaP-0000h0-MQ for qemu-devel@nongnu.org; Fri, 10 Jul 2009 08:52:21 -0400 Received: from outbound-dub.frontbridge.com ([213.199.154.16]:25339 helo=IE1EHSOBE003.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1MPFaP-0007Lz-6d for qemu-devel@nongnu.org; Fri, 10 Jul 2009 08:52:21 -0400 From: Christoph Egger Subject: Re: [Qemu-devel] [PATCH] build fix: xen on NetBSD/amd64 Date: Fri, 10 Jul 2009 14:36:58 +0200 References: <200906301513.12043.Christoph.Egger@amd.com> <200907101019.31977.Christoph.Egger@amd.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200907101436.58550.Christoph.Egger@amd.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org On Friday 10 July 2009 12:18:39 malc wrote: > On Fri, 10 Jul 2009, Christoph Egger wrote: > > On Thursday 09 July 2009 21:21:06 Anthony Liguori wrote: > > > Christoph Egger wrote: > > > > Hi! > > > > > > > > Attached patch fixes this build error on NetBSD/amd64: > > > > > > > > hw/xen_blkif.h:20: warning: #pragma pack(psuh[, id], ) is not > > > > supported on this target > > > > hw/xen_blkif.h:36: warning: #pragma pack(pop[, id], ) is not > > > > supported on this target > > > > > > > > Signed-off-by: Christoph Egger > > > > > > You'll invoke the fury of malc for introducing an identifier that > > > begins with '__' :-) > > > > In NetBSD, there is this in : > > > > #if __GNUC_PREREQ__(2, 7) > > #define __packed __attribute__((__packed__)) > > #define __aligned(x) __attribute__((__aligned__(x))) > > #define __section(x) __attribute__((__section__(x))) > > #elif defined(__PCC__) > > #define __packed _Pragma("packed 1") > > #define __aligned(x) _Pragma("aligned " __STRING(x)) > > #define __section(x) _Pragma("section " ## x) > > #elif defined(__lint__) > > #define __packed /* delete */ > > #define __aligned(x) /* delete */ > > #define __section(x) /* delete */ > > #else > > #define __packed error: no __packed for this compiler > > #define __aligned(x) error: no __aligned for this compiler > > #define __section(x) error: no __section for this compiler > > #endif > > > > > There really isn't pragma pack on NetBSD? That's ashame. > > > > No. Above defines are sufficient and portable. > > Above defines are sufficient but not anywhere near portable. Well, across different compilers, they are. > > Now you know where the __aligned define in my patch comes from. :-) > > You should conditionally include include sys/cdefs.h on NetBSD and not > defining your own version of __aligned (which is forbidden by the > standard). sys/cdefs.h is included implicitely by any libc standard header on NetBSD. No need for an #ifdef __NetBSD__ ... #endif for this. > Few more points: > > a. the file in question already uses aligned attribute _inside_ the > structures without any macros So the pragmas have no effect then ? If so, then just remove them. > b. unlike all other xen* files the header guard is __XEN_BLKIF_H__ > and not QEMU_XEN_BLKIF_H (that should be fixed too) Easy to fix. Will you do or should I send a diff ? Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632