xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wl@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	"Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH] x86/tss: Fix clang build following c/s 7888440625
Date: Wed, 14 Aug 2019 10:37:05 +0000	[thread overview]
Message-ID: <20190814103705.pwvw4bm53marmhiz@liuwe-gateway.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net> (raw)
In-Reply-To: <20190813120117.22528-1-andrew.cooper3@citrix.com>

On Tue, Aug 13, 2019 at 01:01:17PM +0100, Andrew Cooper wrote:
> Clang-3.5 from Debian Jessie fails with:
> 
>   smpboot.c:829:29: error: statement expression not allowed at file scope
>           BUILD_BUG_ON(sizeof(this_cpu(tss_page)) != PAGE_SIZE);
>                               ^
>   /local/xen.git/xen/include/asm/percpu.h:14:7: note: expanded from macro
>           'this_cpu'
>       (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset))
>         ^
>   /local/xen.git/xen/include/xen/compiler.h:98:3: note: expanded from macro
>           'RELOC_HIDE'
>     ({ unsigned long __ptr;                       \
>     ^
>   /local/xen.git/xen/include/xen/lib.h:26:53: note: expanded from macro
>           'BUILD_BUG_ON'
>   #define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
>                                                       ^
>   /local/xen.git/xen/include/xen/lib.h:25:57: note: expanded from macro
>           'BUILD_BUG_ON_ZERO'
>   #define BUILD_BUG_ON_ZERO(cond) sizeof(struct { int:-!!(cond); })
>                                                           ^
>   1 error generated.
>   /local/xen.git/xen/Rules.mk:202: recipe for target 'smpboot.o' failed
> 
> This is obviously a compiler bug because the BUILD_BUG_ON() is not at file
> scope.  However, it can be worked around by using a local variable.
> 
> Spotted by Gitlab CI.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Wei Liu <wl@xen.org>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-08-14 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 12:01 [Xen-devel] [PATCH] x86/tss: Fix clang build following c/s 7888440625 Andrew Cooper
2019-08-14 10:37 ` Wei Liu [this message]
2019-08-27 14:29 ` Jan Beulich

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=20190814103705.pwvw4bm53marmhiz@liuwe-gateway.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net \
    --to=wl@xen.org \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.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).