From owner-freebsd-current@FreeBSD.ORG Tue May 24 03:46:15 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org 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 9CF5016A41C for ; Tue, 24 May 2005 03:46:15 +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 3711A43D1F for ; Tue, 24 May 2005 03:46:15 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from dibbler.crodrigues.org (c-66-30-114-143.hsd1.ma.comcast.net[66.30.114.143]) by comcast.net (sccrmhc12) with ESMTP id <2005052403461301200a5mjre>; Tue, 24 May 2005 03:46:13 +0000 Received: from c-66-30-114-143.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by dibbler.crodrigues.org (8.13.3/8.13.1) with ESMTP id j4O3kJIK063023; Mon, 23 May 2005 23:46:19 -0400 (EDT) (envelope-from rodrigc@c-66-30-114-143.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.3/8.13.1/Submit) id j4O3kIcA063022; Mon, 23 May 2005 23:46:18 -0400 (EDT) (envelope-from rodrigc) Date: Mon, 23 May 2005 23:46:18 -0400 From: Craig Rodrigues To: freebsd-current@freebsd.org Message-ID: <20050524034618.GA62892@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Cc: Kirill Ponomarew Subject: Kernel compilation errors with GCC 4.0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 24 May 2005 03:46:15 -0000 Hi, There was recent mention here: http://lists.freebsd.org/pipermail/freebsd-current/2005-April/049165.html by Kirill Ponomarew that GCC 4.0 would be a good thing to look at for inclusion in the base FreeBSD system. Just out of curiousity, I tried to compile a GENERIC kernel from -CURRENT, and wanted to see how many things would break (because knowing GCC, I knew things would break :). I used the following compiler from ports: gcc version 4.0.1 20050423 (prerelease) [FreeBSD] The pruned down results of what I got are Approx. 70 errors: http://people.freebsd.org/~rodrigc/gcc4.0_fbsdkernel_errors.txt Approx. 2700 warnings, converted to errors by -Werror: http://people.freebsd.org/~rodrigc/gcc4.0_fbsdkernel_warnings.txt I found a few changes in compiler flags with gcc 4.0: (1) The compiler complains that "-I-" is deprecated and that you should use "-iquote DIR" instead. I changed it in src/sys/conf/kern.pre.mk (2) "-mno-align-long-strings" seems to be gone and gives an error if you use it. I commented it out of src/sys/conf/kern.mk (3) "-fformat-extensions" is a FreeBSD extension that is in the FreeBSD system gcc compiler, but not the FSF/ports gcc compiler. I commented it out of /usr/share/mk/bsd.kern.mk There were a lot of warnings (especially in the CAM layer, but in other places too) of the type: /usr/src/sys/cam/cam_periph.c:640: warning: pointer targets in assignment differ in signedness I don't know if these are legitimate things that should be addressed, or if GCC 4.0 is being needlessly pedantic. I did not bother to try to compile any FreeBSD userland or ports. >From what I can tell, a lot of things break with GCC 4.0, so I can't tell if it performs better than GCC 3.4 or not. -- Craig Rodrigues rodrigc@crodrigues.org