From owner-svn-src-all@freebsd.org Sat Oct 24 04:03:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7448FA1BB4B; Sat, 24 Oct 2015 04:03:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23CD01266; Sat, 24 Oct 2015 04:03:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9O43X9p044725; Sat, 24 Oct 2015 04:03:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9O43XqM044724; Sat, 24 Oct 2015 04:03:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510240403.t9O43XqM044724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 24 Oct 2015 04:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289869 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2015 04:03:34 -0000 Author: bdrewery Date: Sat Oct 24 04:03:32 2015 New Revision: 289869 URL: https://svnweb.freebsd.org/changeset/base/289869 Log: Slightly rework the comments and logic for default Clang/GCC. This is because the previous version was very obscure about the fact that despite having Clang "on by default" for architectures such as powerpc, it does not actually build due to the GCC it uses not having C++11 support. Using an external compiler that supports C++11 does allow this to work. This whole block should be rethought more given "on by default" is not really default without extra work which could actually be surprising for why Clang is showing up when using a newer GCC. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Oct 24 04:03:29 2015 (r289868) +++ head/share/mk/src.opts.mk Sat Oct 24 04:03:32 2015 (r289869) @@ -210,21 +210,22 @@ __TT=${MACHINE} .endif .include -.if !${COMPILER_FEATURES:Mc++11} -# If the compiler is not C++11 capable, disable clang and use gcc instead. -__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX -__DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC -.elif ${__T} == "aarch64" || ${__T} == "amd64" || ${__TT} == "arm" || \ - ${__T} == "i386" -# On x86 and arm, clang is enabled, and will be installed as the default cc. +# 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 ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \ + ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") +# Clang is enabled, and will be installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX -.elif ${__T:Mpowerpc*} -# On powerpc, clang is enabled, but gcc is installed as the default cc. +.elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mpowerpc*} +# On powerpc, if an external compiler that supports C++11 is used as ${CC}, +# 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 .else -# Everything else disables clang, and uses gcc instead. +# Everything else disables Clang, and uses GCC instead. __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC .endif