summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-05-21 01:32:23 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-05-21 01:32:23 +0000
commit07b39d8fb08b762a2a3cb224e706e6250f6525c5 (patch)
treeb72b402c6ac2552411ed59fac6e27727db0c4eca /tools
parentb118bc79542f136d3893aa2fc475d6ca78dfbec7 (diff)
downloadFreeBSD-src-07b39d8fb08b762a2a3cb224e706e6250f6525c5.zip
FreeBSD-src-07b39d8fb08b762a2a3cb224e706e6250f6525c5.tar.gz
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
Diffstat (limited to 'tools')
-rw-r--r--tools/build/options/WITHOUT_SYSTEM_COMPILER12
-rw-r--r--tools/build/options/WITH_SYSTEM_COMPILER12
2 files changed, 24 insertions, 0 deletions
diff --git a/tools/build/options/WITHOUT_SYSTEM_COMPILER b/tools/build/options/WITHOUT_SYSTEM_COMPILER
new file mode 100644
index 0000000..01bd89b
--- /dev/null
+++ b/tools/build/options/WITHOUT_SYSTEM_COMPILER
@@ -0,0 +1,12 @@
+.\" $FreeBSD$
+Set to not opportunistically skip building a cross-compiler during the
+bootstrap phase of the build.
+Normally, if the currently installed compiler matches the planned bootstrap
+compiler type and revision, then it will not be built.
+This does not prevent a compiler from being built for installation though,
+only for building one for the build itself.
+The
+.Va WITHOUT_CLANG
+and
+.Va WITHOUT_GCC
+options control those.
diff --git a/tools/build/options/WITH_SYSTEM_COMPILER b/tools/build/options/WITH_SYSTEM_COMPILER
new file mode 100644
index 0000000..3d88bff
--- /dev/null
+++ b/tools/build/options/WITH_SYSTEM_COMPILER
@@ -0,0 +1,12 @@
+.\" $FreeBSD$
+Set to opportunistically skip building a cross-compiler during the
+bootstrap phase of the build.
+If the currently installed compiler matches the planned bootstrap compiler
+type and revision, then it will not be built.
+This does not prevent a compiler from being built for installation though,
+only for building one for the build itself.
+The
+.Va WITHOUT_CLANG
+and
+.Va WITHOUT_GCC
+options control those.
OpenPOWER on IntegriCloud