Date: Wed, 10 Dec 2014 22:33:57 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r275691 - projects/clang350-import/share/mk Message-ID: <201412102233.sBAMXviM062727@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Wed Dec 10 22:33:57 2014 New Revision: 275691 URL: https://svnweb.freebsd.org/changeset/base/275691 Log: Since clang 3.5.0 and later must be built by a compiler with C++11 support, make this explicit in src.opts.mk, by updating the default settings. The defaults become as follows: * If the host compiler is not C++11 capable, use gcc and disable clang. * On x86, enable clang, make it the default cc, and disable gcc. * On little-endian ARM, enable clang, but not the full build, make it the default cc, and disable gcc. * On PowerPC, enable clang, but enable gcc and make that the default cc. * On everything else, use gcc, and disable clang. This can be amended later, if we get e.g. sparc64 or big-endian ARM working with clang. Reviewed by: imp, brooks Differential Revision: https://reviews.freebsd.org/D1294 Modified: projects/clang350-import/share/mk/src.opts.mk Modified: projects/clang350-import/share/mk/src.opts.mk ============================================================================== --- projects/clang350-import/share/mk/src.opts.mk Wed Dec 10 20:54:23 2014 (r275690) +++ projects/clang350-import/share/mk/src.opts.mk Wed Dec 10 22:33:57 2014 (r275691) @@ -191,25 +191,29 @@ __TT=${TARGET} .else __TT=${MACHINE} .endif -# Clang is only for x86, powerpc and little-endian arm right now, by default. -.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} -__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP -.elif ${__TT} == "arm" && ${__T:Marm*eb*} == "" -__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP -# GCC is unable to build the full clang on arm, disable it by default. -__DEFAULT_NO_OPTIONS+=CLANG_FULL -.else -__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP -.endif -# Clang the default system compiler only on little-endian arm and x86. -.if ${__T} == "amd64" || (${__TT} == "arm" && ${__T:Marm*eb*} == "") || \ - ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=CLANG_IS_CC + +.include <bsd.compiler.mk> +.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} == "amd64" || ${__T} == "i386" +# On x86, clang is enabled, and will be installed as the default cc. +__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX +.elif ${__TT} == "arm" && ${__T:Marm*eb*} == "" +# On little-endian arm, clang is enabled, and it is installed as the default +# cc, but since gcc is unable to build the full clang, disable it by default. +__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC +__DEFAULT_NO_OPTIONS+=CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX +.elif ${__T:Mpowerpc*} +# On powerpc, clang is enabled, but gcc is installed as the default cc. +__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX +__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC .else -# If clang is not cc, then build gcc by default -__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP +# 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 .include <bsd.mkopt.mk> @@ -217,7 +221,6 @@ __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP # # MK_* options that default to "yes" if the compiler is a C++11 compiler. # -.include <bsd.compiler.mk> .for var in \ LIBCPLUSPLUS .if !defined(MK_${var})
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412102233.sBAMXviM062727>