svn commit: r325180 - head/share/mk

Bryan Drewery bdrewery at FreeBSD.org
Tue Oct 31 00:03:33 UTC 2017


Author: bdrewery
Date: Tue Oct 31 00:03:32 2017
New Revision: 325180
URL: https://svnweb.freebsd.org/changeset/base/325180

Log:
  Follow-up r320149: Enable GPL_DTC if we're using GCC as the cross-compiler.
  
  This fixes object files landing in the source tree in gnu/usr.bin/dtc
  for GCC platforms.
  
  We cannot reliably detect if an external compiler is used here, and the
  default YES option does include GCC_BOOTSTRAP which implies that GCC may
  be used for the build.
  
  The problem manifests when not using an external compiler, and the host
  compiler is clang.  When a fresh build is done (no OBJDIR yet) the
  'make obj' treewalk is done before 'make cross-tools', so
  COMPILER_FEATURES at this point contains 'c++11' since the host compiler
  was used for COMPILER_FEATURES.  Once cross-tools builds the GCC
  bootstrap compiler and then descends into 'make everything',
  COMPILER_FEATURES no longer contains 'c++11' and MK_GPL_DTC defaults to
  enabled.  Now it builds in gnu/usr.bin/dtc without an OBJDIR preset and
  drops files into the source tree.
  
  The COMPILER_FEATURES check here is useful for knowing if we can *bootstrap*
  C++11 things.  Indeed we do bootstrap dtc as a build tool so it is
  useful for enabling the BSD dtc for the build, but we end up needing the
  GPL dtc for installation anyway.
  
  Reviewed by:	manu, emaste
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D12817

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==============================================================================
--- head/share/mk/src.opts.mk	Tue Oct 31 00:03:29 2017	(r325179)
+++ head/share/mk/src.opts.mk	Tue Oct 31 00:03:32 2017	(r325180)
@@ -227,8 +227,8 @@ __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC
 # If an external compiler that supports C++11 is used as ${CC} and Clang
 # supports the target, then Clang is enabled but GCC is installed as the
 # default /usr/bin/cc.
-__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX
-__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC GPL_DTC LLD
+__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX GPL_DTC
+__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC LLD
 .else
 # Everything else disables Clang, and uses GCC instead.
 __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC


More information about the svn-src-head mailing list