From owner-freebsd-arch@FreeBSD.ORG Wed Feb 27 20:33:01 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 CEDFEAEF; Wed, 27 Feb 2013 20:33:01 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og117.obsmtp.com (exprod7og117.obsmtp.com [64.18.2.6]) by mx1.freebsd.org (Postfix) with ESMTP id 86415DA2; Wed, 27 Feb 2013 20:33:01 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob117.postini.com ([64.18.6.12]) with SMTP ID DSNKUS5tddOLxS47iTPQHHVa4eX48bzFMTtE@postini.com; Wed, 27 Feb 2013 12:33:01 PST Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 27 Feb 2013 12:28:23 -0800 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id r1RKSM349648; Wed, 27 Feb 2013 12:28:22 -0800 (PST) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 8F53B58096; Wed, 27 Feb 2013 12:28:22 -0800 (PST) To: Brooks Davis Subject: Re: [RFC] external compiler support In-Reply-To: <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> <20130227195807.GA19255@lor.one-eyed-alien.net> Comments: In-reply-to: Brooks Davis message dated "Wed, 27 Feb 2013 13:58:07 -0600." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 27 Feb 2013 12:28:22 -0800 Message-ID: <20130227202822.8F53B58096@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain 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 20:33:01 -0000 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 The advantage of Warner's approach is that it can work from anywhere in the tree rather than only from top-level. 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. 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: # add machine/taget flags in order of least to most specific CFLAGS+= ${CFLAGS.${MACHINE}} \ ${CFLAGS.${.TARGET:T:R}} \ ${CFLAGS.${.TARGET:T}} etc. I also find it handy to have CFLAGS_LAST+= ${CFLAGS_LAST.${MACHINE}} \ ${CFLAGS_LAST.${.TARGET:T:R}} \ ${CFLAGS_LAST.${.TARGET:T}} 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. >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. No, they just need to be part of the compiler command line. >Otherwise /rescue fails as do several things in /boot. That would presumably be bugs in the relevant makefiles no?