From: Ian Campbell Subject: Re: [xen-unstable test] 16231: regressions - FAIL Date: Mon, 25 Feb 2013 11:03:22 +0000 Message-ID: <1361790202.26546.172.camel@zakaz.uk.xensource.com> References: <1361783984.26546.160.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1361783984.26546.160.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Keir Fraser Cc: "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Mon, 2013-02-25 at 09:19 +0000, Ian Campbell wrote: > The problem is the use of '#pragma pack(4)' when building the foreign > headers on x86_32. IIRC this is to deal with the fact that on x86_32 8-byte types are 4-byte aligned when they are within a struct. This is not the case on 32-bit ARM. The following skanky test on armv7 returns: align of uint32_t 4 align of uint64_t 8 align of struct foo.t32 4 align of struct foo.t64 8 Compared with x86_32: align of uint32_t 4 align of uint64_t 8 align of struct foo.t32 4 align of struct foo.t64 4 Ian #include #include #include struct foo { uint32_t t32; uint64_t t64; }; int main (void) { struct foo f; printf("align of uint32_t %d\n", __alignof__(uint32_t)); printf("align of uint64_t %d\n", __alignof__(uint64_t)); printf("align of struct foo.t32 %d\n", __alignof__(f.t32)); printf("align of struct foo.t64 %d\n", __alignof__(f.t64)); return 0; }