From owner-freebsd-current@FreeBSD.ORG Thu Sep 4 18:20:24 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 538C316A4BF for ; Thu, 4 Sep 2003 18:20:24 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0573A43FA3 for ; Thu, 4 Sep 2003 18:20:23 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h851J2wO049541; Thu, 4 Sep 2003 18:19:02 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h851J2Z4001006; Thu, 4 Sep 2003 18:19:02 -0700 (PDT) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h851J22f001005; Thu, 4 Sep 2003 18:19:02 -0700 (PDT) (envelope-from marcel) Date: Thu, 4 Sep 2003 18:19:02 -0700 From: Marcel Moolenaar To: Marius Strobl Message-ID: <20030905011902.GA955@athlon.pn.xcllnt.net> References: <20030904180448.021a1b6b.Alexander@Leidinger.net> <20030904162858.GI98381@dan.emsphone.com> <20030905001411.3a9030b3.Alexander@Leidinger.net> <20030904224709.GA48780@ns1.xcllnt.net> <20030905025922.A68885@newtrinity.zeist.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030905025922.A68885@newtrinity.zeist.de> User-Agent: Mutt/1.5.4i cc: Alexander Leidinger cc: current@freebsd.org Subject: Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2003 01:20:24 -0000 On Fri, Sep 05, 2003 at 02:59:22AM +0200, Marius Strobl wrote: > > > > We use the size of the symbol (ie the size of the object identified > > by the symbol) to pass around values. This we do by creating arrays. > > If we want to export a C constant 'FOOBAR' to assembly and the constant > > is defined to be 6, then we create an array for the sign, of which the > > size is 1 for negative numbers and 0 otherwise. In this case the array > > will be named FOOBARsign and its size is 0. We also create 4 arrays (*w0, > > *w1, *w2 and *w3), each with a maximum of 64K and corresponding to the > > 4 16-bit words that constitutes a single 64-bit entity. > > In this case > > 00000006 C FOOBARw0 > > 00000000 C FOOBARw1 > > 00000000 C FOOBARw2 > > 00000000 C FOOBARw3 > > > > If the compiler creates arrays of size 1 for arrays we define as a > > zero-sized array, you get exactly what you've observed. > > Is this rather complex approach really necessary? In theory, yes. In practice, maybe not. If I remember correctly, the problem we're trying to solve is twofold: 1. 64-bit constants given the limitations of the object format, which included widths of 32-bit and a.out. 2. Sign extension or datatype limitations in awk(1)? I'm not sure about this point. Bruce? > ... The genassym.sh(8) of NetBSD kind > of directly exports the C-constants so it just needs one symbol per > constant and doesn't require zero sized arrays. Given that it's from > NetBSD their approach also should be very MI. I wouldn't have a problem using NetBSD's genassym implementation, provided we understand completely how it differs from ours and to what extend and how it affects us and provided of course we can live with whatever it is that's worse of just different from what we have now. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net