From owner-freebsd-current@FreeBSD.ORG Thu Aug 22 18:27:31 2013 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4C85E89D; Thu, 22 Aug 2013 18:27:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21EDA2321; Thu, 22 Aug 2013 18:27:30 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VCZbQ-000IjZ-6T; Thu, 22 Aug 2013 18:27:24 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r7MIRKXm046807; Thu, 22 Aug 2013 12:27:20 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18/5eD9+i1tdcxnzF3E93/n Subject: Re: why does buildkernel set COMPILER_TYPE? From: Ian Lepore To: John-Mark Gurney In-Reply-To: <20130822162353.GF94127@funkthat.com> References: <20130822040418.GE94127@funkthat.com> <49A46D2E-D736-4D57-BB54-5B68C1FE2466@FreeBSD.org> <20130822162353.GF94127@funkthat.com> Content-Type: text/plain; charset="us-ascii" Date: Thu, 22 Aug 2013 12:27:20 -0600 Message-ID: <1377196040.1111.26.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Brooks Davis , Dimitry Andric , current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Aug 2013 18:27:31 -0000 On Thu, 2013-08-22 at 09:23 -0700, John-Mark Gurney wrote: > Dimitry Andric wrote this message on Thu, Aug 22, 2013 at 08:59 +0200: > > On Aug 22, 2013, at 06:04, John-Mark Gurney wrote: > > > I've noticed that if you do a: > > > make buildworld WITHOUT_CLANG_IS_CC=YES > > > > > > and then do a: > > > make buildkernel > > > > > > (w/o the WITHOUT_CLANG_IS_CC=YES option) > > > that it fails... > > > > Why don't you just put the WITHOUT_CLANG_IS_CC setting in /etc/src.conf, > > where it belongs? That would save you this trouble. > > Except that I'm testing code that needs to work both with clang and > gcc... Putting an option like that in /etc/src.conf is bad as I'm > likely to forget it, plus it'll effect other trees which isn't good... > > > I don't think we should support building different parts of the tree > > with incompatible settings. E.g. compiling part of the tree using > > WITH_FOO, and some other part using WITHOUT_FOO is *not* supposed to > > work properly. > > Do we have a file that is source in /usr/src (or where your source tree > is located) that we can put these options in? > You can put them in any file you want, and point to it with SRCCONF= on the command line. It doesn't make sense to define a standard location within the source tree, because it has to be possible to build from a read-only tree, and also that still doesn't address the problem of "today I want to build this source with gcc, tomorrow I want to build the same source with clang without modifying anything in the source tree." It might be kind of nice if by default the build system looked first in ../etc/ rather than /etc for {make,src}.conf, then you could have an etc directory "associated with the source" but maintain the readonly nature of src/ itself. Likewise look first for ../obj instead of /usr/obj. This is basically what I do, but it requires me to have a wrapper script that sets up the make command line with all the right overrides to use the build config based on where I usually keep it "in association with the source" which for me is a directory named config/ at the same level as src/ that's being built. -- Ian > When we finally are able to build and install all as a normal user > (which we are getting close now), /etc/src.conf is a really bad place > to put these things.... > > > > Apparently instead of letting buildkernel figure out > > > which compiler it will use, the src/Makefile.inc1 forces COMPILER_TYPE > > > to be what the options specified instead of using what bsd.compiler.mk > > > figures out... > > > > This was added by brooks in r240468 (and further developed in r250659 > > where he added external compiler support), with what I assume is the > > explanation in the commit message: > > > > "To avoid negative performance impacts in the default case and correct > > value for COMPILER_TYPE type is determined and passed in the environment > > of submake instances while building world." > > > > So I suspect this is really on purpose. Brooks, any comments? :) > > Except that KMAKEENV just blindly takes all of WMAKEENV... I > understand why WMAKEENV would have COMPILER_TYPE, I'm just puzzled why > we don't let KMAKEENV figure out the correct one... >