From owner-freebsd-current@FreeBSD.ORG Tue Aug 30 18:13:41 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4C62106566C; Tue, 30 Aug 2011 18:13:41 +0000 (UTC) (envelope-from ohartman@zedat.fu-berlin.de) Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9D78FC1A; Tue, 30 Aug 2011 18:13:41 +0000 (UTC) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost1.zedat.fu-berlin.de (Exim 4.69) with esmtp (envelope-from ) id <1QySoe-0003ff-I8>; Tue, 30 Aug 2011 20:13:40 +0200 Received: from e178029245.adsl.alicedsl.de ([85.178.29.245] helo=thor.walstatt.dyndns.org) by inpost2.zedat.fu-berlin.de (Exim 4.69) with esmtpsa (envelope-from ) id <1QySoe-0002lM-Er>; Tue, 30 Aug 2011 20:13:40 +0200 Message-ID: <4E5D2854.1030305@zedat.fu-berlin.de> Date: Tue, 30 Aug 2011 20:13:40 +0200 From: "Hartmann, O." User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0) Gecko/20110825 Thunderbird/6.0 MIME-Version: 1.0 To: Dimitry Andric References: <4E5CB1E9.9080801@zedat.fu-berlin.de> <4E5D0DD3.20606@FreeBSD.org> <4E5D24DE.8050909@FreeBSD.org> In-Reply-To: <4E5D24DE.8050909@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: 85.178.29.245 Cc: freebsd-current , Alex Kuster Subject: Re: CLANG; still cc in use when building the WORLD with CLANG? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 30 Aug 2011 18:13:42 -0000 On 08/30/11 19:58, Dimitry Andric wrote: > On 2011-08-30 18:44, Alex Kuster wrote: >> Thanks for pointing out those details ! >> This whole thing about make.conf& src.conf is very confusing and >> gives the >> impression of something half ported ... > > The only thing that is "half ported" at the moment, is an easy "use > clang to build world" switch. This will be properly addressed after 9.0 > is released. As to the make.conf/src.conf confusion, it is very simple > really: > > - make.conf is used for system-wide settings, applied to every build > using make. > > - src.conf is used for setting FreeBSD source tree settings, which are > always of the form WITH_XXX or WITHOUT_XXX. See src.conf(5) for a > full list. Any other "make" settings, such as CC, CFLAGS, etc, are > better specified in make.conf, though the manpage does not tell you > so explicitly. This is as I understood the manpage of src.conf. There is only a YES/set and NO/unset. Well, I might be wrong, but FreeBSD separates strictly the core operating system and the ports stuff. When it came to CLANG compiled core system and I read about src.conf, my intuitive thinking was that this is the long awaited separation from having everything mixed in /etc/make.conf (by the way, somehow I feel I would all the ports stuff, even it make.conf, looking for at /usr/local/etc/make.conf ...). > > Now, why do some settings, such as CFLAGS, in src.conf not always work > correctly? Because src.conf is only read when bsd.own.mk is included > (implicitly or explicitly) in a Makefile, and this is *not* always done > at the start of the file. > > On the other hand, make.conf is read from /usr/share/sys.mk, which is > automatically included before anything else is done. > > Take, for example, the Makefile for cp(1), in /usr/src/bin/cp (I > prefixed line numbers for reference): > > 1: # @(#)Makefile 8.1 (Berkeley) 5/31/93 > 2: # $FreeBSD: head/bin/cp/Makefile 192586 2009-05-22 15:56:43Z trasz $ > 3: > 4: PROG= cp > 5: SRCS= cp.c utils.c > 6: CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE > 7: > 8: .include > > At line 1, make will already have read make.conf, picking up settings > from it. Suppose it picks up "CFLAGS=-foo". > > At line 6, CFLAGS has several flags appended. Its value will then > become "-foo -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE". > > At line 8, bsd.prog.mk is read, which (through bsd.own.mk) belatedly > reads src.conf. If you have a setting such as "CFLAGS=-bar" in it, this > value will *override* the previous one, possibly having disastrous > consequences. Great! Many thanks, this is a nice explanation. With such detailed info it's a bit easier to hunt down the mistakes I made for my own. Thanks again. Oliver