From owner-freebsd-arch@FreeBSD.ORG Wed Feb 27 21:06:42 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4657D763 for ; Wed, 27 Feb 2013 21:06:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-gg0-x22e.google.com (mail-gg0-x22e.google.com [IPv6:2607:f8b0:4002:c02::22e]) by mx1.freebsd.org (Postfix) with ESMTP id E82CBF4D for ; Wed, 27 Feb 2013 21:06:41 +0000 (UTC) Received: by mail-gg0-f174.google.com with SMTP id k5so159452ggd.19 for ; Wed, 27 Feb 2013 13:06:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=rfGVNZXMbaLFsq33plymT1RxUqC8jv112kzHfgWt9Xw=; b=VR4P7toRzCIahb9PWVJZ1QzcZnyQHoF5P877RVi6TiOhI3pegFGpp1xuNlUzoIrXq8 twipE9fBdUcKRrvES2h9YIQVhMWvfvxIvJasoWrShqgV19lwOpkXuTiSkXi5hKcEk6wP 7U64/51+aN9Hmz35sIxRR0fylFUe8gOOBsjgX2bTwpUVJIGcAN7bHWtYyRe8Pz6hGsa0 pctj134IyCOsqh2ihBGb5YWq94qMS+a50eSvZJmqVl6r0HAJS9IrZnvY6PniArCH/k3b rbrVsHTQYblWFFMX+xl38pMM3gAf15oWCv4LfVD5ooUMIB5QzPtnIUuTFfma8oickeHE l/mQ== X-Received: by 10.236.127.179 with SMTP id d39mr2800205yhi.20.1361999201495; Wed, 27 Feb 2013 13:06:41 -0800 (PST) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPS id s3sm9634087yhm.10.2013.02.27.13.06.38 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Feb 2013 13:06:39 -0800 (PST) Sender: Warner Losh Subject: Re: [RFC] external compiler support Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130227202822.8F53B58096@chaos.jnpr.net> Date: Wed, 27 Feb 2013 14:06:36 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <09800C62-25DA-4BE4-B87B-8B2F0E1C0AF9@bsdimp.com> 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> <20130227195807.GA19255@lor.one-eyed-alien.net> <20130227202822.8F53B58096@chaos.jnpr.net> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmmQWI89i4shU2qkft0YDQ/9Rylv5w6UuWqoy44j04uYCMDAt0xtSltDN6OSezbP/hGksvf Cc: Brooks Davis , 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 21:06:42 -0000 On Feb 27, 2013, at 1:28 PM, Simon J. Gerraty wrote: >=20 > On Wed, 27 Feb 2013 13:58:07 -0600, Brooks Davis writes: >> 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 >=20 > The advantage of Warner's approach is that it can work from anywhere = in > the tree rather than only from top-level. >=20 > One of my goals is that I should be able to [cross-]build bin/cat just > as easily from src/bin/cat as from top-level. > Warner's approach fits better in that regard. >=20 > There is of course a lot more needed. > Being able to add machine and even target specific flags for example. > These can be just as easily dealt with in share/mk: >=20 > # add machine/taget flags in order of least to most specific > CFLAGS+=3D ${CFLAGS.${MACHINE}} \ > ${CFLAGS.${.TARGET:T:R}} \ > ${CFLAGS.${.TARGET:T}} >=20 > etc. I also find it handy to have=20 >=20 > CFLAGS_LAST+=3D ${CFLAGS_LAST.${MACHINE}} \ > ${CFLAGS_LAST.${.TARGET:T:R}} \ > ${CFLAGS_LAST.${.TARGET:T}} >=20 > and add ${CFLAGS_LAST} to CFLAGS after Makefile has been read > so for example when you don't have proper sysroot support you can add > the equivalent of -I/tree/of/headers/include to the end of the -I = list. Yes. We don't really have proper sysroot support in our build tree, or = at least didn't for the longest time, so our build doesn't depend on it. = I'm OK making it depend on it, so long as we have this sort of fallback = for includes and libraries... >> This appears to work: >>=20 >> --sysroot /tree/of/headers/and/libraries -B/path/to/binutils >>=20 >> For the whole tree to build it must be part of the value of CC. >=20 > No, they just need to be part of the compiler command line. Correct. I said in email a second ago I wanted to do CC?=3D"${__X}cc = ${__Y}" but what I really want is a CFLAGS=3D"${__Y}..." instead. Again, = for properly named __X and __Y... >> Otherwise /rescue fails as do several things in /boot. >=20 > That would presumably be bugs in the relevant makefiles no? Yea, since I've build the whole tree with 'make xdev'-built external = tools with at least some version of the stuff I build. There was no = problem with /boot and only minor issues with /rescue which were long = ago fixed. Warner=