From owner-freebsd-current@FreeBSD.ORG Tue Dec 2 05:05:32 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2B02B43 for ; Tue, 2 Dec 2014 05:05:32 +0000 (UTC) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98A9AE96 for ; Tue, 2 Dec 2014 05:05:32 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id fb1so12736429pad.27 for ; Mon, 01 Dec 2014 21:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=from:content-type:mime-version:subject:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=niZiYJY83c6RTu2yxNNS659KfapclwMhjpbUoZhbRos=; b=Hwo1JMC4KwBY0tQ7Ut1FQzVJrE+SvJTrGRdcqAHwENomU3YlxBdwbO6KmKYzV/FxJ9 7CycJtOdvhMWEbyQHyneRIrq29nZ+uY3lWhZwg+0FV2w0ulKWoEe7fD9sb34ztbRzn1V tF2W4eIZnFD5NisClw0sM7kaYW15jOgkOdPg8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=niZiYJY83c6RTu2yxNNS659KfapclwMhjpbUoZhbRos=; b=dWA9gvvem0HvzRz/OQCWHz9b5/jhCdvd8bWilg1brTPccwXovuRtwOCXIMY8AKPDAN /UD17wce7QJcpOdwqPJppZY5fR9OwWB2IMEMFKERt1UjEDXyZwdgNAtG+fsTo+ms7VDC jAAVt8A5OueIaZ+tpDqcTLVmRrAnhzUSkYQ3McjyeDt0bxcMlegslA3xlxGFJ0e6ZbfA oJCqKYYheNWa7+daJ5H5xTmu9mGNlyYLl4HdlFKcrY2vjxgErTq5KAxfPTXsPWOWWgvr xsCdjQK10NT/1bOHOyjfml7TKKlgn6pnZFpsU9gmiGBpE8rhAc6z2d/RESZsrH3STscb ty8Q== X-Gm-Message-State: ALoCoQmPBYpaN9McIqLqIhiJANwo4a3OOVpSOvmKPAHvt/0henQZbqOgdqEQljxRTqN8hjjiGj2a X-Received: by 10.68.241.10 with SMTP id we10mr2177180pbc.101.1417496732181; Mon, 01 Dec 2014 21:05:32 -0800 (PST) Received: from [10.64.24.134] ([69.53.236.236]) by mx.google.com with ESMTPSA id u4sm18926587pbs.60.2014.12.01.21.05.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 21:05:31 -0800 (PST) From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: External toolchain support In-Reply-To: <20141129150440.GC88765@ivaldir.etoilebsd.net> Date: Mon, 1 Dec 2014 22:05:29 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20141129150440.GC88765@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1993) X-Mailman-Approved-At: Tue, 02 Dec 2014 05:20:15 +0000 Cc: current@FreeBSD.org 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: Tue, 02 Dec 2014 05:05:33 -0000 > On Nov 29, 2014, at 8:04 AM, Baptiste Daroussin = wrote: >=20 > Hi all, >=20 > It is now possible to use an external toolchain to build the kernel = and base > (tested with gcc 4.9.1 and latest binutils) >=20 > Of course a lot of work is needed to make it build cleanly (aka lots = of warning > to fix). >=20 > What have been tested so far: > - sparc64 kernel + world > - amd64 kernel + world > - powerpc64 kernel + world >=20 > mips cannot be tested because upstream gcc never heard of FreeBSD = running on > mips, and I did not receive any patches for mips. I have patches for 4.8 or so knocking around somewhere... > 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. >=20 > The result is: >=20 > $ sysctl kern.ostype kern.osrelease kern.osrevision = kern.compiler_version >=20 > kern.ostype: FreeBSD > kern.osrelease: 11.0-CURRENT > kern.osrevision: 199506 > kern.compiler_version: gcc version 4.9.1 (FreeBSD Ports Collection for = amd64) >=20 > so yes it boots and runs >=20 > 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 >=20 > if your source tree: > make CROSS_TOOLCHAIN=3Damd64-gcc -j8 buildkernel > or > make CROSS_TOOLCHAIN=3Dpowerpc64-gcc -j8 buildkernel > or > make CROSS_TOOLCHAIN=3Dsparc64-gcc -j8 buildkernel >=20 > 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/) >=20 > 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=3D and > fix the issue they are hidding! Cool. Please coordinate with me before removing the -Wno-error because = they vary by architecture. Warner