From owner-freebsd-current@FreeBSD.ORG Thu Sep 4 09:03: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 78B8A16A4BF for ; Thu, 4 Sep 2003 09:03:24 -0700 (PDT) Received: from mailout01.sul.t-online.com (mailout01.sul.t-online.com [194.25.134.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F66043FF5 for ; Thu, 4 Sep 2003 09:03:20 -0700 (PDT) (envelope-from Alexander@Leidinger.net) Received: from fwd02.aul.t-online.de by mailout01.sul.t-online.com with smtp id 19uwZr-0006j2-04; Thu, 04 Sep 2003 18:03:19 +0200 Received: from Andro-Beta.Leidinger.net (SmTwwyZcoeDskBb+8lzZPAoR1YTfCKlGDzl77sXkqFizMLs3-BzCsn@[217.83.31.76]) by fmrl02.sul.t-online.com with esmtp id 19uwZX-0TX6fo0; Thu, 4 Sep 2003 18:02:59 +0200 Received: from Magelan.Leidinger.net (Magelan [192.168.1.1]) h84G41Nt013911 for ; Thu, 4 Sep 2003 18:04:01 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from Magelan.Leidinger.net (netchild@localhost [127.0.0.1]) by Magelan.Leidinger.net (8.12.9/8.12.9) with SMTP id h84G4mu2062164 for ; Thu, 4 Sep 2003 18:04:48 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Date: Thu, 4 Sep 2003 18:04:48 +0200 From: Alexander Leidinger To: current@freebsd.org Message-Id: <20030904180448.021a1b6b.Alexander@Leidinger.net> X-Mailer: Sylpheed version 0.9.3claws (GTK+ 1.2.10; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Seen: false X-ID: SmTwwyZcoeDskBb+8lzZPAoR1YTfCKlGDzl77sXkqFizMLs3-BzCsn@t-dialin.net Subject: 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 Reply-To: netchild@FreeBSD.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2003 16:03:24 -0000 Hi, I'm in the process of building our kernel with Intels C Compiler (icc). So far we are able to build a working UP and SMP kernel (not completely automated). Most of it works just fine (NFS-client is known to not work). At the moment I discussing an issue with Intel regarding 0-sized arrays. gcc seems to be violating the standard and produces code with an array size of "0", whereas icc produces code where an 0-sized array has the size "1". This results in different nm output of genassym.o: gcc generated: ---snip--- 00000000 C BC32SELsign 00000050 C BC32SELw0 00000000 C BC32SELw1 00000000 C BC32SELw2 00000000 C BC32SELw3 ---snip--- icc generated: ---snip--- 00000001 C BC32SELsign 00000050 C BC32SELw0 00000001 C BC32SELw1 00000001 C BC32SELw2 00000001 C BC32SELw3 ---snip--- Thus the output of genassym.sh with a icc generated genassym.o is wrong: ---snip--- #define BC32SEL -0x1000100010050 #define BI_ENDCOMMON -0x100010001000c #define BI_ESYMTAB -0x1000100010044 #define BI_KERNELNAME -0x1000100010004 #define BI_KERNEND -0x1000100010048 #define BI_NFS_DISKLESS -0x1000100010008 #define BI_SIZE -0x1000100010030 ---snip--- With a gcc generated genassym.o it looks like: ---snip--- #define BC32SEL 0x50 #define BI_ENDCOMMON 0xc #define BI_ESYMTAB 0x44 #define BI_KERNELNAME 0x4 #define BI_KERNEND 0x48 #define BI_NFS_DISKLESS 0x8 #define BI_SIZE 0x30 ---snip--- At least the generated defines are used in locore.s, but is this the only consumer of this "feature"? What I need to know is: - Do we really depend on 0-sized arrays in the code or is it just a genassym.sh issue? - If we depend on it: how hard would it be to rewrite it to not depend on 0-sized arrays (and does someone volunteer to rewrite it)? It would be nice if someone could point me to the source if it isn't an easy task, my contact @Intel is willing to convince the developers to change icc, but he has to "present a persuasive argument to development to pursue a solution". - If it is a genassym.sh issue: would someone with enough glue please provide me with a patch for genassym.sh which either uses a switch to understand the icc generated file or is able to detect it on it's own (I'm able to provide the output of nm and/or the object file)? Or at least describes what needs to be done, so I can try do do it myself after refreshing my awk knowledge? Bye, Alexander. -- Failure is not an option. It comes bundled with your Microsoft product. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7