From patchwork Mon Mar 7 18:28:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 8521591 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 CA8249F7CA for ; Mon, 7 Mar 2016 18:31:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 061CB2010E for ; Mon, 7 Mar 2016 18:31:56 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1EB51200F4 for ; Mon, 7 Mar 2016 18:31:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aczto-000217-Dn; Mon, 07 Mar 2016 18:28:56 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1acztn-000211-AL for xen-devel@lists.xen.org; Mon, 07 Mar 2016 18:28:55 +0000 Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id 2B/40-02979-368CDD65; Mon, 07 Mar 2016 18:28:51 +0000 X-Env-Sender: prvs=86744e631=Andrew.Cooper3@citrix.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1457375329!20838400!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: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46667 invoked from network); 7 Mar 2016 18:28:50 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 7 Mar 2016 18:28:50 -0000 X-IronPort-AV: E=Sophos;i="5.22,552,1449532800"; d="scan'208";a="343805160" From: Andrew Cooper To: Xen-devel Date: Mon, 7 Mar 2016 18:28:42 +0000 Message-ID: <1457375322-7975-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Andrew Cooper , Julien Grall , Ian Jackson , Wei Liu , Stefano Stabellini Subject: [Xen-devel] [PATCH] tools/foreign: Avoid using alignment directives when not appropriate X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 The foreign header generation blindly replaces 'uint64_t' with '__align8__ uint64_t', to get correct alignment when built as 32bit. This is correct in most circumstances, but Clang objects to two specific uses. * Inside a sizeof() expression * As part of a typecast An example error looks like: /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))) ^~~~~~~~~~~ This sedary is sufficient to fix all the bad examples without touching any of the legitimate uses, and is more simple than teaching mkheader.py how to parse C. Signed-off-by: Andrew Cooper --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall --- tools/include/xen-foreign/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile index 80a446a..b25bfa8 100644 --- a/tools/include/xen-foreign/Makefile +++ b/tools/include/xen-foreign/Makefile @@ -35,6 +35,8 @@ 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,$^) + #Avoid mixing an alignment directive with a uint64_t cast or sizeof expression + sed 's/(__align8__ uint64_t)/(uint64_t)/g' -i $@ checker.c: mkchecker.py structs.py $(PYTHON) $< $@ $(architectures)