From owner-freebsd-toolchain@FreeBSD.ORG Sun Jan 9 11:38:29 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D472106564A; Sun, 9 Jan 2011 11:38:29 +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 E3FA48FC08; Sun, 9 Jan 2011 11:38:28 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:7c79:31ca:edb:edcd] (unknown [IPv6:2001:7b8:3a7:0:7c79:31ca:edb:edcd]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 692625C5A; Sun, 9 Jan 2011 12:38:26 +0100 (CET) Message-ID: <4D299E37.7080103@FreeBSD.org> Date: Sun, 09 Jan 2011 12:38:31 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.14pre) Gecko/20110104 Lanikai/3.1.8pre MIME-Version: 1.0 To: Alexander Best References: <20110109005017.GA8384@freebsd.org> In-Reply-To: <20110109005017.GA8384@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@freebsd.org Subject: Re: searchpath for clang X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 11:38:29 -0000 On 2011-01-09 01:50, Alexander Best wrote: > i just noticed that when CC is set to clang, target buildworld will honour > $PATH, whereas target buildkernel doesn't. shouldn't target buildworld also > discarg $PATH? It does discard PATH. See the top Makefile, one of the first things it does is: PATH= /sbin:/bin:/usr/sbin:/usr/bin And for subsequent stages, PATH is set to various other values. > i have a clang 2.9 svn snapshot installed under /usr/local/bin > and target buildworld failed, because this version was picked up instead of the > one under /usr/bin. Are you building world with CC=/usr/local/bin/clang? If so, that is most likely your problem. Specifying a full path for CC (or CXX) always overrides the command used during the world stage. Normally, CC is set to "cc" or "clang", so without any absolute path. During the various build stages, PATH is set to different values, causing *different* compiler and binutils executables to be used during those stages, e.g.: - /usr/bin/cc, /usr/bin/ld and so on, during the legacy, bootstrap-tools, build-tools and cross-tools stages. - ${WORLDTMP}/usr/bin/cc, ${WORLDTMP}/usr/bin/ld and so on, during the world and install stages. In your case, if you want to compile the bootstrap stages with clang trunk, but the world with the version of clang that is in the source tree, you must modify the top Makefile to have: PATH= /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin and then use CC=clang, CXX=clang++.