From owner-freebsd-arch@FreeBSD.ORG Wed Aug 3 20:01:49 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 93A8116A41F for ; Wed, 3 Aug 2005 20:01:49 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5E7043D46 for ; Wed, 3 Aug 2005 20:01:48 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-66-30-115-133.hsd1.ma.comcast.net ([66.30.115.133]) by comcast.net (sccrmhc12) with ESMTP id <2005080320014301200pbujce>; Wed, 3 Aug 2005 20:01:45 +0000 Received: from c-66-30-115-133.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by c-66-30-115-133.hsd1.ma.comcast.net (8.13.4/8.13.1) with ESMTP id j73K1hiZ070809 for ; Wed, 3 Aug 2005 16:01:43 -0400 (EDT) (envelope-from rodrigc@c-66-30-115-133.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-115-133.hsd1.ma.comcast.net (8.13.4/8.13.1/Submit) id j73K1heB070808 for freebsd-arch@freebsd.org; Wed, 3 Aug 2005 16:01:43 -0400 (EDT) (envelope-from rodrigc) Date: Wed, 3 Aug 2005 16:01:43 -0400 From: Craig Rodrigues To: freebsd-arch@freebsd.org Message-ID: <20050803200143.GA70735@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Subject: [RFC] Kernel patches for compilation with gcc 4.0 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2005 20:01:49 -0000 Hi, I installed gcc version 4.0.2 20050721 (prerelease) [FreeBSD] from ports and tried to compile the kernel using a LINT config file on i386. I had to apply these patches: http://people.freebsd.org/~rodrigc/fbsd.makefiles.diff.txt to the kernel makefile rules because "-I-" is removed from gcc 4.0, and "-fformat-extensions" is a FreeBSD extension to GCC which is not in the ports version of the compiler. I had to apply these patches to the source code to eliminate errors: http://people.freebsd.org/~rodrigc/fbsd.kernel.gcc40.diffs.txt Mostly I fixed cases like this: extern struct foo bar; static struct foo bar = { }; In ISO C, it is illegal to define a struct with external linkage, and then internal linkage. GCC 3.x allows it, but GCC 4.x flags it as an error. Also, if you do: static struct foo bar; static struct foo bar = { }; then the -Wredundant-decls flag in the kernel makefile will issue a warning. Can someone provide feedback on the kernel patches? Thanks. -- Craig Rodrigues rodrigc@crodrigues.org