commit 8ff2c682625c0d7e3efc30aa1ec758a7a98d6912 Author: Bryan Drewery Date: Fri Jun 15 09:27:20 2018 -0700 Fix X_COMPILER_* and X_LINKER_* not being passed to installworld environment. This could lead to 'sh: head: not found' warnings which were a symptom of running 'ld --version' during installworld. This was only happening with XCC or XLD set. It is intended that cc and ld do not run during installworld. The metadata for these are already stored in compiler-metadata.mk added in r316794. This also removes redundant CROSSENV additions that were for WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, and WITHOUT_TOOLCHAIN which all don't have a cc or ld in their PATH during install. Reported by: Mark Millard MFC after: 2 weeks Sponsored by: Dell EMC diff --git Makefile.inc1 Makefile.inc1 index 18bd7ecd3ac2..4d716b490486 100644 --- Makefile.inc1 +++ Makefile.inc1 @@ -166,22 +166,6 @@ test-system-compiler: .PHONY .info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler. .endif -# For installworld need to ensure that the looked-up compiler metadata is -# passed along rather than trying to run cc from the restricted -# STRICTTMPPATH. -.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" -.if !defined(X_COMPILER_TYPE) -CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ - COMPILER_TYPE=${COMPILER_TYPE} \ - COMPILER_FEATURES="${COMPILER_FEATURES}" \ - COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} -.else -CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ - COMPILER_FEATURES="${X_COMPILER_FEATURES}" \ - COMPILER_TYPE=${X_COMPILER_TYPE} \ - COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} -.endif -.endif # Store some compiler metadata for use in installworld where we don't # want to invoke CC at all. _COMPILER_METADATA_VARS= COMPILER_VERSION \ @@ -197,8 +181,10 @@ compiler-metadata.mk: .PHONY .META > ${.TARGET} .for v in ${_COMPILER_METADATA_VARS} @echo "${v}=${${v}}" >> ${.TARGET} + @echo "X_${v}=${X_${v}}" >> ${.TARGET} .endfor @echo ".export ${_COMPILER_METADATA_VARS}" >> ${.TARGET} + @echo ".export ${_COMPILER_METADATA_VARS:C,^,X_,}" >> ${.TARGET} # Handle external binutils. .if defined(CROSS_TOOLCHAIN_PREFIX)