From owner-freebsd-current@FreeBSD.ORG Sat Nov 29 15:04:46 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 24A294BC for ; Sat, 29 Nov 2014 15:04:46 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (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 AE3B410E for ; Sat, 29 Nov 2014 15:04:45 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id ex7so20796218wid.3 for ; Sat, 29 Nov 2014 07:04:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=RS1pS9B1vn9n5AWOB+u37gzzk5SHxetMWO25xmk52w8=; b=N55gpXpcOoeqXxSwgp1slqQ6XCOQZZv7HsYgR9ljWv5FTWFUe6Y80zFxX5c+Xgu7SN q0Nr0jS9JyQRQI919zI/vE8DvPRfLwbL90OsI0HbwBdZY11qG4h0QpE6LSFkgxzq+CrS zUMCpI/kPkV1/q4XiwZWJr5VzjkskpnToEbkNwTYBPauX1YNChy2v0P+rrDoCORi33Ig 8TtM1CpwYLXKmwVTKqrH0JovWHwIsudSw4gL5GMWaj9uoqf9Qc3qpBvVZu2yXpqTkyaa PrNPx1UuzP3k2e4rYi55HwXGYxer1q2F8pmZLLWRGpHn8CvoDB2Ps4GRvFj+gAtGIbep vXlA== X-Received: by 10.180.8.34 with SMTP id o2mr67780324wia.23.1417273484055; Sat, 29 Nov 2014 07:04:44 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id eq4sm892894wjd.42.2014.11.29.07.04.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Nov 2014 07:04:42 -0800 (PST) Sender: Baptiste Daroussin Date: Sat, 29 Nov 2014 16:04:40 +0100 From: Baptiste Daroussin To: current@FreeBSD.org Subject: External toolchain support Message-ID: <20141129150440.GC88765@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kVXhAStRUZ/+rrGn" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) 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: Sat, 29 Nov 2014 15:04:46 -0000 --kVXhAStRUZ/+rrGn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --kVXhAStRUZ/+rrGn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlR54IUACgkQ8kTtMUmk6ExU4wCeN7li9npTpjBD/jSfiWbfUX/U aFkAnRxQPk/7y2iqCaTZR25RVxqc1re0 =JNu6 -----END PGP SIGNATURE----- --kVXhAStRUZ/+rrGn--