From owner-svn-src-all@freebsd.org Wed Oct 31 10:45:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A6810D2A88; Wed, 31 Oct 2018 10:45:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45C926F026; Wed, 31 Oct 2018 10:45:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0761A32CA; Wed, 31 Oct 2018 10:45:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VAjSTF012969; Wed, 31 Oct 2018 10:45:28 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VAjSs7012968; Wed, 31 Oct 2018 10:45:28 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810311045.w9VAjSs7012968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 31 Oct 2018 10:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339946 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 339946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 10:45:29 -0000 Author: arichardson Date: Wed Oct 31 10:45:28 2018 New Revision: 339946 URL: https://svnweb.freebsd.org/changeset/base/339946 Log: Don't run cc --version during cleandir/obj stages This will no work when there is no cc in $PATH (which is the case before the cross-tools stage once we no longer inherit $PATH in $WMAKE). The variables set by bsd.compiler.mk/bsd.linker.mk are not needed in these stages so this avoids a little bit of makefile parsing. Reviewed By: emaste Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D16814 Modified: head/Makefile.inc1 head/share/mk/bsd.compiler.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 31 10:30:19 2018 (r339945) +++ head/Makefile.inc1 Wed Oct 31 10:45:28 2018 (r339946) @@ -950,7 +950,7 @@ _worldtmp: .PHONY .else ${_+_}@if [ -e "${WORLDTMP}" ]; then \ echo ">>> Deleting stale files in build tree..."; \ - cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ + cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES _NO_INCLUDE_COMPILERMK=t \ delete-old delete-old-libs >/dev/null; \ fi rm -rf ${WORLDTMP}/legacy/usr/include @@ -1003,19 +1003,21 @@ _cleanobj: @echo "--------------------------------------------------------------" @echo ">>> stage 2.1: cleaning up the object tree" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR} + # Avoid including bsd.compiler.mk in clean and obj with _NO_INCLUDE_COMPILERMK + # since the restricted $PATH might not contain a valid cc binary + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t ${CLEANDIR} .if defined(LIBCOMPAT) - ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} -f Makefile.inc1 ${CLEANDIR} + ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} _NO_INCLUDE_COMPILERMK=t -f Makefile.inc1 ${CLEANDIR} .endif .else - ${_+_}cd ${.CURDIR}; ${WMAKE} _cleanobj_fast_depend_hack + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t _cleanobj_fast_depend_hack .endif # !defined(NO_CLEAN) _obj: @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.2: rebuilding the object tree" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} obj + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t obj _build-tools: @echo @echo "--------------------------------------------------------------" Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Oct 31 10:30:19 2018 (r339945) +++ head/share/mk/bsd.compiler.mk Wed Oct 31 10:45:28 2018 (r339946) @@ -33,6 +33,16 @@ ____: .include +.if defined(_NO_INCLUDE_COMPILERMK) +# If _NO_INCLUDE_COMPILERMK is set we are doing a make obj/cleandir/cleanobj +# and might not have a valid compiler in $PATH yet. In this case just set the +# variables that are expected by the other .mk files and return +COMPILER_TYPE=none +X_COMPILER_TYPE=none +COMPILER_VERSION=0 +X_COMPILER_VERSION=0 +COMPILER_FEATURES=none +.else # command = /usr/local/bin/ccache cc ... # wrapper = /usr/local/libexec/ccache/cc ... CCACHE_BUILD_TYPE?= command @@ -220,4 +230,5 @@ ${var}.${${X_}_cc_hash}:= ${${var}} .if !defined(_NO_INCLUDE_LINKERMK) .include .endif +.endif # defined(_NO_INCLUDE_COMPILERMK) .endif # !target(____)