Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2015 20:37:00 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289663 - head/share/mk
Message-ID:  <201510202037.t9KKb0sk064214@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Tue Oct 20 20:37:00 2015
New Revision: 289663
URL: https://svnweb.freebsd.org/changeset/base/289663

Log:
  Improve safety of caching from r289659 by only importing of none of the
  variables are already set.  This should cover odd cases such as the
  COMPILER_TYPE override in lib/csu/powerpc64.
  
  X-MFC-With:	r289659
  MFC after:	3 weeks
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.compiler.mk

Modified: head/share/mk/bsd.compiler.mk
==============================================================================
--- head/share/mk/bsd.compiler.mk	Tue Oct 20 20:35:34 2015	(r289662)
+++ head/share/mk/bsd.compiler.mk	Tue Oct 20 20:37:00 2015	(r289663)
@@ -31,11 +31,20 @@ __<bsd.compiler.mk>__:
 _exported_vars=	COMPILER_TYPE COMPILER_VERSION
 _cc_hash=	${CC}${MACHINE}${PATH}
 _cc_hash:=	${_cc_hash:hash}
+# Only import if none of the vars are set somehow else.
+_can_export=	yes
+.for var in ${_exported_vars}
+.if defined(${var})
+_can_export=	no
+.endif
+.endfor
+.if ${_can_export} == yes
 .for var in ${_exported_vars}
 .if defined(${var}.${_cc_hash})
 ${var}=	${${var}.${_cc_hash}}
 .endif
 .endfor
+.endif
 
 .if ${MACHINE} == "common"
 # common is a pseudo machine for architecture independent



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510202037.t9KKb0sk064214>