From owner-freebsd-arch@FreeBSD.ORG Wed Feb 27 19:58:08 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 68631A23 for ; Wed, 27 Feb 2013 19:58:08 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 12DF5AD7 for ; Wed, 27 Feb 2013 19:58:06 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r1RJw7sM019371; Wed, 27 Feb 2013 13:58:07 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r1RJw7vC019370; Wed, 27 Feb 2013 13:58:07 -0600 (CST) (envelope-from brooks) Date: Wed, 27 Feb 2013 13:58:07 -0600 From: Brooks Davis To: "Simon J. Gerraty" Subject: Re: [RFC] external compiler support Message-ID: <20130227195807.GA19255@lor.one-eyed-alien.net> References: <20130227003517.GB7348@lor.one-eyed-alien.net> <28404C12-67F3-44F0-AB28-02B749472873@bsdimp.com> <51BB3E17-128A-4989-B272-D8B40D4B854B@bsdimp.com> <20130227175006.A604A58096@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <20130227175006.A604A58096@chaos.jnpr.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 19:58:08 -0000 --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 27, 2013 at 09:50:06AM -0800, Simon J. Gerraty wrote: >=20 > On Wed, 27 Feb 2013 09:08:05 -0700, Warner Losh writes: > >> I think this will work, but it is kludgy. I had created a __X=3D > > > >I also am having trouble finding my full patch, but a partial patch can = be fou >=20 > I prefer this approach too, but would use a more explicit variable than > __X (which I could easily imagine someone thinking they could safely use > within their own makefile for some purpose). > Eg. we currently have stuff like: >=20 > CC?=3D ${BUILD_TOOL_PREFIX}/${CROSS_TARGET_PREFIX}gcc >=20 > since these aren't variables that anyone needs to manipulate regularly > a little verbosity doesn't hurt. >=20 > Further, having them composed from other bits can also be useful > (eg. most dev machines here use nfs mounted toolchains, but others use > local toolchains). >=20 > So (probably taking things too far - I didn't come up with all this ;-) >=20 > BUILD_TOOL_PREFIX?=3D ${TOOLCHAIN_PREFIX}/${TOOLCHAIN_${MACHINE}}/bin > CROSS_TARGET_PREFIX?=3D ${CROSS_TARGET}- > CROSS_TARGET?=3D ${CROSS_TARGET_${MACHINE}} >=20 > and a toolchain.mk sets CROSS_TARGET_* for all the supported machines. Adding the equivalent of Warner's ${__X} (however you spell it) doesn't seem to hurt anything, but it doesn't seem to help much either. You quickly end up setting many of the values. I'd be fine with adding something if it seems generally useful, but I don't think I'd use it at all in a buildworld/buildkernel type cross build where I want to control the whole name of the commands without having to hack up a directory of symlinks to the tools I intend to use (in our case, we're only replacing the compiler and want to easily switch between 3-4 non-default versions of clang). > Of course as you note: >=20 > >I've also started looking into using clang --mumble to doing cross build= s too, >=20 > can simplify things (for some value of "--mumble); I managed to get > clang to produce i386 apps on amd64, but the "--mumble" wasn't obvious > or documented (that I could find) and infact the man page implied other= =20 > things that don't work. This appears to work: --sysroot /tree/of/headers/and/libraries -B/path/to/binutils For the whole tree to build it must be part of the value of CC. Otherwise /rescue fails as do several things in /boot. -- Brooks --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRLmVPXY6L6fI4GtQRAiHgAKCcYEX73XaheAjR7KPePfBaab8jSACgq8Bs Bu9jWLKtcdPmNrly2JGkC6M= =its8 -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--