From owner-freebsd-current@FreeBSD.ORG Sun Nov 30 17:02:14 2014 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5323984; Sun, 30 Nov 2014 17:02:14 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 34E18971; Sun, 30 Nov 2014 17:02:14 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 74A7B341F84E; Sun, 30 Nov 2014 09:02:08 -0800 (PST) Message-ID: <547B4D89.7030402@mu.org> Date: Sun, 30 Nov 2014 09:02:01 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , current@FreeBSD.org Subject: Re: External toolchain support References: <20141129150440.GC88765@ivaldir.etoilebsd.net> In-Reply-To: <20141129150440.GC88765@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-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: Sun, 30 Nov 2014 17:02:14 -0000 On 11/29/14, 7:04 AM, Baptiste Daroussin wrote: > Hi all, > > It is now possible to use an external toolchain to build the kernel and base > (tested with gcc 4.9.1 and latest binutils) > > Of course a lot of work is needed to make it build cleanly (aka lots of warning > to fix). > > What have been tested so far: > - sparc64 kernel + world > - amd64 kernel + world > - powerpc64 kernel + world > > mips cannot be tested because upstream gcc never heard of FreeBSD running on > mips, and I did not receive any patches for mips. > > for amd64, in the kernel two things had to be removed from the build: > - aesni: (it request a header which is compiler specific and on recent gcc > will end up including stdlib.h which gives errors because kernel version of free > and malloc are not compatible with the version defined in stdlib.h) > - hptmv: I had to remove it from GENERIC and kernel building. > > The result is: > > $ sysctl kern.ostype kern.osrelease kern.osrevision kern.compiler_version > > kern.ostype: FreeBSD > kern.osrelease: 11.0-CURRENT > kern.osrevision: 199506 > kern.compiler_version: gcc version 4.9.1 (FreeBSD Ports Collection for amd64) > > so yes it boots and runs > > How to do you own testing: > in the ports tree/packages (the amd64 version will appear in packages next week) > install: > amd64-xtoolchain-gcc or powerpc64-xtoolchain-gcc or sparc64-xtoolchain-gcc > > if your source tree: > make CROSS_TOOLCHAIN=amd64-gcc -j8 buildkernel > or > make CROSS_TOOLCHAIN=powerpc64-gcc -j8 buildkernel > or > make CROSS_TOOLCHAIN=sparc64-gcc -j8 buildkernel > > To build world: > same operation with buildworld. Please note that for world you will need to add > define NO_WERROR (world will also require a change in share/mk/bsd.lib.mk: > s/--fatal-warnings/--no-fatal-warnings/) > > also notes that for the kernel a lots of warnings are disabled in > share/sys/kern.mk so do not hesitate to remove yourself those -Wno-error= and > fix the issue they are hidding! > > Best regards, > Bapt This is amazing work, thank you Bapt! -Alfred