freebsd-dev/share
Bryan Drewery 6120aabd32 Opportunistically skip building a cross-compiler with SYSTEM_COMPILER set.
This will still build the compiler for the target but will not build the
bootstrap cross-compiler in the cross-tools phase.  Other toolchain
bootstrapping, such as elftoolchan and binutils, currently still occurs.

This will utilize the default CC (cc, /usr/bin/cc) as an external compiler.

This is planned to be on-by-default eventually.

This will utilize the __FreeBSD_cc_version compiler macro defined in the
source tree and compare it to CC's version.  If they match then the
cross-compiler is skipped.  If [X]CC is an external compiler (absolute
path) or WITHOUT_CROSS_COMPILER is already set, then this logic is skipped.
If the expected bootstrap compiler type no longer matches the found CC
compiler type (clang vs gcc), then the logic is skipped.  As an extra
safety check the version number is also compared from the compiler to
the tree version.

Clang:
  The macro FREEBSD_CC_VERSION is defined in:
    lib/clang/include/clang/Basic/Version.inc
  For clang -target will be used if TARGET_ARCH != MACHINE_ARCH.  This
  is from the current external toolchain logic.  There is currently an
  assumption that the host compiler can build the TARGET_ARCH.  This
  will usually be the case since we don't conditionalize target arch
  support in clang, but it will break when introducing new
  architectures.  This problem is mitigated by incrementing the version
  when adding new architectures.

GCC:
  The macro FBSD_CC_VER is defined in:
    gnu/usr.bin/cc/cc_tools/freebsd-native.h
  For GCC there is no simple -target support when TARGET_ARCH !=
  MACHINE_ARCH.  In this case the opportunistic skip is not done.  If we
  add proper support for this case in external toolchain logic then it
  will be fine to enable.

This relies on the macros being incremented whenever any change occurs
to these compilers that warrant rebuilding files.  It also should never
repeat earlier values.

Reviewed by:	brooks, bapt, imp
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6357
2016-05-21 01:32:23 +00:00
..
colldef Regenerate the Makefile so that actually the new generated collation are 2016-04-16 19:39:51 +00:00
ctypedef Regenerates locales Makefiles and locales 2016-04-16 17:55:11 +00:00
dict Add META_MODE support. 2015-06-13 19:20:56 +00:00
doc Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
dtrace Remove the old version of the DTraceToolkit from the source tree. 2016-05-19 19:51:39 +00:00
examples Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
i18n Remove exists() checks so normal out-of-date handling can be used. 2016-03-11 23:45:36 +00:00
keys META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
locale-links Regenerates locales Makefiles and locales 2016-04-16 17:55:11 +00:00
man Add sglist functions for working with arrays of VM pages. 2016-05-20 23:28:43 +00:00
me Add META_MODE support. 2015-06-13 19:20:56 +00:00
misc Add myself to the list of src committers. I've never been added it 2016-05-12 20:04:09 +00:00
mk Opportunistically skip building a cross-compiler with SYSTEM_COMPILER set. 2016-05-21 01:32:23 +00:00
monetdef Regenerates locales Makefiles and locales 2016-04-16 17:55:11 +00:00
msgdef Regenerates locales Makefiles and locales 2016-04-16 17:55:11 +00:00
numericdef Regenerates locales Makefiles and locales 2016-04-16 17:55:11 +00:00
security META MODE: These need object directories to handle staging. 2015-11-26 01:14:27 +00:00
sendmail Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
skel Use more appropriate ${SHAREDIR} rather than /usr/share. 2015-10-27 23:35:02 +00:00
snmp Add META_MODE support. 2015-06-13 19:20:56 +00:00
syscons DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools. 2016-05-09 22:21:09 +00:00
tabset Add META_MODE support. 2015-06-13 19:20:56 +00:00
termcap Replace ln -s calls with INSTALL_SYMLINK 2015-12-04 03:17:14 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
timedef Regenerates locales Makefiles and locales 2016-04-16 17:55:11 +00:00
vt Remove uudecode make rule for vt fonts 2016-02-29 18:35:16 +00:00
zoneinfo Rework META_TARGETS so that it automatically adds META_DEPS to the targets. 2016-04-14 21:04:42 +00:00
Makefile Merge from head 2015-10-19 11:51:10 +00:00
Makefile.inc