Index: share/mk/src.opts.mk =================================================================== --- share/mk/src.opts.mk +++ share/mk/src.opts.mk @@ -199,6 +199,9 @@ CLANG_EXTRAS \ DTRACE_TESTS \ EXPERIMENTAL \ + GCC \ + GCC_BOOTSTRAP \ + GNUCXX \ GNU_GREP_COMPAT \ GPL_DTC \ HESIOD \ @@ -297,24 +300,22 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF .include -# If the compiler is not C++11 capable, disable Clang and use GCC instead. -# This means that architectures that have GCC 4.2 as default can not -# build Clang without using an external compiler. +# If the compiler is not C++11 capable, disable Clang. External toolchain will +# be required. .if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips" && \ ${__TT} != "riscv" && ${__TT} != "sparc64") # Clang is enabled, and will be installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD -__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX .elif ${COMPILER_FEATURES:Mc++11} && ${__T} != "sparc64" # 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 +# supports the target, then Clang is enabled but we still require an external +# toolchain. # default /usr/bin/cc. -__DEFAULT_YES_OPTIONS+=CLANG GCC GCC_BOOTSTRAP GNUCXX LLD +__DEFAULT_YES_OPTIONS+=CLANG LLD __DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC .else # Everything else disables Clang, and uses GCC instead. -__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD .endif # In-tree binutils/gcc are older versions without modern architecture support.