From owner-freebsd-arm@FreeBSD.ORG Sun Nov 12 16:59:16 2006 Return-Path: X-Original-To: arm@freebsd.org Delivered-To: freebsd-arm@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D699116A412; Sun, 12 Nov 2006 16:59:16 +0000 (UTC) (envelope-from nick@flirble.org) Received: from plum.flirble.org (plum.flirble.org [195.40.6.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id D379643D60; Sun, 12 Nov 2006 16:59:05 +0000 (GMT) (envelope-from nick@flirble.org) Received: from nick by plum.flirble.org with local (Exim 4.43) id 1GjIfg-000GU4-BE; Sun, 12 Nov 2006 16:59:04 +0000 Date: Sun, 12 Nov 2006 16:59:04 +0000 From: Nicholas Clark To: Ruslan Ermilov Message-ID: <20061112165904.GP6501@plum.flirble.org> Mail-Followup-To: Ruslan Ermilov , Giorgos Keramidas , arm@freebsd.org, current@freebsd.org References: <20061112133929.9194773068@freebsd-current.sentex.ca> <20061112140010.GA47660@rambler-co.ru> <20061112142710.GE91556@wombat.fafoe.narf.at> <20061112133929.9194773068@freebsd-current.sentex.ca> <20061112140010.GA47660@rambler-co.ru> <20061112144230.GC2331@kobe.laptop> <20061112145151.GC49703@rambler-co.ru> <20061112151150.GA2988@kobe.laptop> <20061112155723.GB50349@rambler-co.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061112155723.GB50349@rambler-co.ru> User-Agent: Mutt/1.3.25i X-Organisation: Tetrachloromethane Sender: Nicholas Clark Cc: arm@freebsd.org, Giorgos Keramidas , current@freebsd.org Subject: Re: [head tinderbox] failure on arm/arm X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Nov 2006 16:59:17 -0000 On Sun, Nov 12, 2006 at 06:57:23PM +0300, Ruslan Ermilov wrote: > So your sizeof() argument, well... I don't understand it and it > doesn't make things clearer at least to me. I still believe this > is bug in GCC that the alignment requirement is so high for a > "struct foo { char x; }" (there's no real reason for this!). It is no bug in GCC. ANSI C gives extreme flexibility for the compiler to align (or pad) structures. The assumptions in the code you presented are not portable. The problem tends to be that ARM is the only common platform that does structure alignment this way, so tends to trip up a lot of code that has worked just fine in many other places. There is a lot more detail in http://netwinder.osuosl.org/users/b/brianbr/public_html/alignment.html including how gcc's __packed__ extention can be used to tell gcc to align structures in different ways. Nicholas Clark