From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 18:19:21 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 60E02106564A for ; Fri, 28 Oct 2011 18:19:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 23F778FC12 for ; Fri, 28 Oct 2011 18:19:21 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:4c76:9767:f5a:f9ce] (unknown [IPv6:2001:7b8:3a7:0:4c76:9767:f5a:f9ce]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E7D2A5C37; Fri, 28 Oct 2011 20:19:18 +0200 (CEST) Message-ID: <4EAAF228.1060000@FreeBSD.org> Date: Fri, 28 Oct 2011 20:19:20 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111019 Thunderbird/8.0 MIME-Version: 1.0 To: Dominic Fandrey References: <4EA80BD3.7000202@bsdforen.de> <4EA81B90.60501@FreeBSD.org> <4EAABF2E.3030709@bsdforen.de> In-Reply-To: <4EAABF2E.3030709@bsdforen.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: 9.0 RC1 linking problem with i386 libs on amd64 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: Fri, 28 Oct 2011 18:19:21 -0000 On 2011-10-28 16:41, Dominic Fandrey wrote: ... > Like that: > .if ${.CURDIR:M/usr/src} || ${.CURDIR:M/usr/src/*} > CC=clang > CXX=clang++ > CPP=clang-cpp > NO_WERROR= > WERROR= > .endif > > I had hoped that the .ifdef construction from the wiki was dated. I > suppose it's emulating setting CC in the environment instead of in > the make/src.conf. There are two different problems here. One is that src.conf is read relatively late, and only when bsd.own.mk is included. Therefore, src.conf is not the right place to put CC, CXX and so on. The other problem is that the build32 stage uses environment variables to override CC, CXX, AS and LD for its sub-make (see LIB32WMAKEENV in Makefile.inc1), adding the necessary flags for 32-bit compilation. However, since environment variables are in turn overridden by direct assignments (like via reading make.conf), the 32-bit compilation flags get lost when you specify any of CC, CXX, AS or LD in make.conf. This latter problem is what my patch attempts to fix, while changing as little as possible. ... > I tried CC?=, but that doesn't work, because apparently make always > initializes CC before parsing makefiles. Yes, that is because make implicitly reads sys.mk, which either defines CC directly, or through reading make.conf. ... > I didn't try it, though. Your patch works for me. > >> I would really like to have this in head, and even stable/9. It makes >> it possible to just set CC in make.conf, without .ifdef trickery. Works >> nicely for clang, too. :) > > Seconded! If there aren't any objections, I will commit it this weekend.