From owner-svn-src-head@FreeBSD.ORG Fri Jan 10 03:08:09 2014 Return-Path: Delivered-To: svn-src-head@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 2EDD0D9E; Fri, 10 Jan 2014 03:08:09 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id B28231CFC; Fri, 10 Jan 2014 03:08:08 +0000 (UTC) Received: from c122-106-144-87.carlnfd1.nsw.optusnet.com.au (c122-106-144-87.carlnfd1.nsw.optusnet.com.au [122.106.144.87]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 357ADD616D3; Fri, 10 Jan 2014 14:07:58 +1100 (EST) Date: Fri, 10 Jan 2014 14:07:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric Subject: Re: svn commit: r259730 - in head: gnu/lib/csu gnu/lib/libgcc gnu/lib/libstdc++ gnu/lib/libsupc++ lib/atf/libatf-c/tests share/mk sys/conf tools/tools/ath/athstats tools/tools/net80211/wlanstats usr.bi... In-Reply-To: Message-ID: <20140110132845.W935@besplex.bde.org> References: <201312221751.rBMHpYpj059326@svn.freebsd.org> <7BAB80DB-AD2E-427A-AB9F-2E1A3F0DFE8C@FreeBSD.org> <1389279751.1158.426.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=p/w0leo876FR0WNmYI1KeA==:117 a=PO7r1zJSAAAA:8 a=OnJtn-i5wDAA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=KAlrzZ-J0aMA:10 a=6I5d2MoRAAAA:8 a=JxsaJ2YE-OGrro_P9XYA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: Zbigniew Bodek , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ian Lepore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2014 03:08:09 -0000 On Thu, 9 Jan 2014, Dimitry Andric wrote: > On 09 Jan 2014, at 16:02, Ian Lepore wrote: > ... >> At r259730: >> >> cc -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs >> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline >> -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions >> -Wmissing-include-dirs -fdiagnostics-show-option >> -Wno-error-tautological-compare -Wno-error-empty-body >> -Wno-error-parentheses-equality -nostdinc -I. >> -I/local/build/staging/freebsd/imx53/src/sys >> -I/local/build/staging/freebsd/imx53/src/sys/contrib/altq >> -I/local/build/staging/freebsd/imx53/src/sys/contrib/libfdt -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -funwind-tables >> -ffreestanding >> -Werror /local/build/staging/freebsd/imx53/src/sys/arm/arm/trap.c >> >> The difference is that the -mllvm and -arm-enable-ehabi flags are >> missing. > > Aha, this was a nasty mistake, sorry. The main kernel builds do not > include bsd.sys.mk, so CFLAGS.clang and CFLAGS.gcc do not work there at > the moment. Fixed in r260494. It is a bug for kernel builds to include anything in /usr/share/mk, since this gives a dependency on the host environment. This bug is very old, but not too bad for files that should rarely change, e.g., sys.mk. It it is very bad for critical variations of CFLAGS. The old bug has been expanded exponentially by namespace pollution in environment files. Old versions of conf/*.mk have only the following includes: kern.post.mk:.include "kern.mk" kmod.mk:.include kmod.mk:.include kmod.mk:.include kmod.mk:.include kmod.mk:.include "kern.mk" This shows that the old bug was only in kmod.mk and in nested pollution in sys.mk. It used to be in kern.post.mk, when that included bsd.kern.mk instead of kern.mk. This was fixed for new sources by moving bsd.kern.mk to kern.mk in the kernel source tree, but collaterally enlarged for old sources by removing bsd.kern.mk from the host source tree (thus, old kernel sources no longer compiled with new hosts, even if nothing in *kern.mk changed). The other includes here shouldn't cause any problems since they shouldn't do anything that depends on the host environment including the compiler. conf/*.mk now has the following includes: kern.post.mk:.include "kern.mk" kern.pre.mk:.include kern.pre.mk:.include kmod.mk:.include kmod.mk:.include kmod.mk:.include kmod.mk:.include kmod.mk:.include kmod.mk:.include "kern.mk" bsd.sys.mk still isn't explicitly here. For modules, it is included by bsd.kmod.mk. The layering for *kmod.mk is backwards: - modules Makefiles include bsd.kmod.mk from the host environment - bsd.kmod.mk guesses the system directory and includes conf/kmod.mk from there - conf/kmod.mk then includes other files from the host environment, as above - bsd.kmod.mk then includes bsd.sys.mk from the host environment. This bug is old. I think you just copied the bug from bsd.kmod.mk so that it affects kernel builds too. Bruce