From patchwork Fri Feb 12 16:20:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 8292971 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DFF3A9F372 for ; Fri, 12 Feb 2016 16:24:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFB8A20221 for ; Fri, 12 Feb 2016 16:24:51 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CAB732015A for ; Fri, 12 Feb 2016 16:24:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aUGTM-0006pX-GJ; Fri, 12 Feb 2016 16:21:32 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aUGTK-0006pM-G9 for xen-devel@lists.xen.org; Fri, 12 Feb 2016 16:21:30 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id 1E/3D-02940-9860EB65; Fri, 12 Feb 2016 16:21:29 +0000 X-Env-Sender: prvs=843bae1bd=Andrew.Cooper3@citrix.com X-Msg-Ref: server-16.tower-31.messagelabs.com!1455294087!14553174!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11282 invoked from network); 12 Feb 2016 16:21:28 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-16.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 12 Feb 2016 16:21:28 -0000 X-IronPort-AV: E=Sophos;i="5.22,436,1449532800"; d="scan'208";a="337863778" To: Jan Beulich References: <56BDF969.9010701@citrix.com> <56BE108302000078000D17D7@prv-mh.provo.novell.com> From: Andrew Cooper X-Enigmail-Draft-Status: N1110 Message-ID: <56BE065F.3070201@citrix.com> Date: Fri, 12 Feb 2016 16:20:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <56BE108302000078000D17D7@prv-mh.provo.novell.com> X-DLP: MIA1 Cc: Ian Jackson , Wei Liu , Ian Campbell , Xen-devel List Subject: Re: [Xen-devel] Clang tools build X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 12/02/16 16:04, Jan Beulich wrote: >>>> On 12.02.16 at 16:25, wrote: >> Hello, >> >> Now that Clang 3.5 can build the hypervisor, I was just preparing a >> patch to README, and encountered this: >> >> In file included from xc_altp2m.c:23: >> In file included from ./xc_private.h:35: >> In file included from ./include/xenctrl.h:53: >> /local/xen.git/tools/libxc/../../tools/include/xen/foreign/x86_64.h:203:47: >> error: 'aligned' attribute ignored when parsing type >> [-Werror,-Wignored-attributes] >> __align8__ uint64_t evtchn_pending[sizeof(__align8__ uint64_t) * 8]; >> ^~~~~~~~~~ >> /local/xen.git/tools/libxc/../../tools/include/xen/foreign/x86_64.h:13:36: >> note: expanded from macro '__align8__' >> # define __align8__ __attribute__((aligned (8))) >> ^~~~~~~~~~~ >> /local/xen.git/tools/libxc/../../tools/include/xen/foreign/x86_64.h:204:44: >> error: 'aligned' attribute ignored when parsing type >> [-Werror,-Wignored-attributes] >> __align8__ uint64_t evtchn_mask[sizeof(__align8__ uint64_t) * 8]; >> ^~~~~~~~~~ >> /local/xen.git/tools/libxc/../../tools/include/xen/foreign/x86_64.h:13:36: >> note: expanded from macro '__align8__' >> # define __align8__ __attribute__((aligned (8))) >> ^~~~~~~~~~~ >> 2 errors generated. >> >> In this case, Clang is complaining that the alignment attribute is wrong >> for uint64_t. This is correct for 64bit compilations, but wrong for >> 32bit. > If it only complains about it when used as operand to sizeof() I > think it's correctly saying so. Turns out that a fix^W gross hack of checker.c: mkchecker.py structs.py $(PYTHON) $< $@ $(architectures) Does indeed fix the build. There are problems with sizeof(), and later, an explicit (__align8__ uint64_t) cast. Unfortunately, mkheader is doing dumb translation, and I don't fancy teaching it how to parse C. I will see if there is something neater I can do as a solution. Also, further real issues have surfaces, so I will have to submit a series cleaning up the tools/ compile with Clang. ~Andrew diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile index 80a446a..d9f68cd 100644 --- a/tools/include/xen-foreign/Makefile +++ b/tools/include/xen-foreign/Makefile @@ -35,6 +35,7 @@ x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/ x86_64.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_64.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h $(PYTHON) $< $* $@ $(filter %.h,$^) + sed 's/(__align8__ uint64_t)/(uint64_t)/g' -i $@