From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 28 01:14:40 2014 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEA11F2D; Tue, 28 Jan 2014 01:14:40 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0213150E; Tue, 28 Jan 2014 01:14:40 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s0S1EdY2064516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 Jan 2014 17:14:40 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s0S1EdWM064515; Mon, 27 Jan 2014 17:14:39 -0800 (PST) (envelope-from jmg) Date: Mon, 27 Jan 2014 17:14:39 -0800 From: John-Mark Gurney To: Brooks Davis Subject: Re: make buildkernel figure out compiler type.. Message-ID: <20140128011439.GV13704@funkthat.com> Mail-Followup-To: Brooks Davis , hackers@freebsd.org References: <20140124200141.GE75135@funkthat.com> <20140127172842.GE8857@lor.one-eyed-alien.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140127172842.GE8857@lor.one-eyed-alien.net> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 27 Jan 2014 17:14:40 -0800 (PST) Cc: hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2014 01:14:41 -0000 Brooks Davis wrote this message on Mon, Jan 27, 2014 at 11:28 -0600: > On Fri, Jan 24, 2014 at 12:01:42PM -0800, John-Mark Gurney wrote: > > When I was building armeb, I would often specify the correct compiler > > on buildtools/kernel-tools, but then when I went to buildkernel, I > > would forget... So, I figured out if we just drop COMPILER_TYPE from > > KMAKEENV, the right magic will be executed to figure out which of > > clang/gcc should be used... > > > > $ svn diff Makefile.inc1 > > Index: Makefile.inc1 > > =================================================================== > > --- Makefile.inc1 (revision 260499) > > +++ Makefile.inc1 (working copy) > > @@ -451,7 +451,7 @@ IMAKE_MTREE= MTREE_CMD="nmtree ${MTREEFLAGS}" > > .endif > > > > # kernel stage > > -KMAKEENV= ${WMAKEENV} > > +KMAKEENV= ${WMAKEENV:NCOMPILER_TYPE=*} > > KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} > > > > # > > > > Comments? > > If COMPILER_TYPE isn't set then every submake will need to figure out > which compiler is in use. That's not too expensive for a build without > modules, but is potentially quite expensive with, hence the passing of > COMPILER_TYPE. I'm not convinced the tradeoff is worth it for a little > edge-case user convenience. Interestingly, I decided to try to test this out, and I couldn't measure a performance difference between the two.. This was using a "make buildkernel -j 8" on amd64 which builds all the modules and I couldn't measure a performance difference between the two... After seeing an output of make -dA, I doubt executing a couple more commands will really make that much of a measurable difference... Also, won't it be set once at the top? If not, why don't we export COMPILER_TYPE when we set it, then that'd solve your issue? right? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."