From: Christoph Egger <Christoph.Egger@amd.com>
To: malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] build fix: xen on NetBSD/amd64
Date: Fri, 10 Jul 2009 14:36:58 +0200 [thread overview]
Message-ID: <200907101436.58550.Christoph.Egger@amd.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0907101413030.2160@linmac.oyster.ru>
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], <n>) is not
> > > > supported on this target
> > > > hw/xen_blkif.h:36: warning: #pragma pack(pop[, id], <n>) is not
> > > > supported on this target
> > > >
> > > > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
> > >
> > > You'll invoke the fury of malc for introducing an identifier that
> > > begins with '__' :-)
> >
> > In NetBSD, there is this in <sys/cdefs.h> :
> >
> > #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
next prev parent reply other threads:[~2009-07-10 12:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 13:13 [Qemu-devel] [PATCH] build fix: xen on NetBSD/amd64 Christoph Egger
2009-07-09 19:21 ` Anthony Liguori
2009-07-10 8:19 ` Christoph Egger
2009-07-10 10:18 ` malc
2009-07-10 12:36 ` Christoph Egger [this message]
2009-07-10 15:22 ` malc
2009-07-17 13:28 ` Christoph Egger
2009-07-17 16:58 ` malc
2009-07-10 12:58 ` Anthony Liguori
2009-07-10 13:20 ` Christoph Egger
2009-07-10 15:24 ` malc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907101436.58550.Christoph.Egger@amd.com \
--to=christoph.egger@amd.com \
--cc=av1474@comtv.ru \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).