> On Mar 12, 2015, at 6:36 PM, Mark Millard <[email protected]> wrote: > > Basic context for the observation (powerpc64 example): > > # freebsd-version -ku; uname -a > 11.0-CURRENT > 11.0-CURRENT > FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279514M: Wed Mar 11 > 19:23:14 PDT 2015 > root@FBSDG4C0:/usr/obj/powerpc.powerpc64/usr/srcC/sys/GENERIC64vtsc-NODEBUG > powerpc > > > As COMPILER_FEATURES context first I note that bsd.compiler.mk uses the > rule... > > .if ${COMPILER_TYPE} == "clang" || \ > (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800) > COMPILER_FEATURES= c++11 > .else > COMPILER_FEATURES= > .endif > > So powerpc/powerpc64 ends up with COMPILER_FEATURES being empty unless > COMPILER_TYPE has been forced to be "clang" or ${CC} already is clang based. > > But src.opts.mk will never indicate to build clang when > !${COMPILER_FEATURES:Mc++11} : that logic has priority over things like > ${__T:Mpowerpc*} tests…
Clang can only be built by a new gcc or clang. Old gcc can’t build it, so if
you don’t have a new gcc, you can’t build clang. The default compiler was gcc
on 10.1. There likely should be an UPDATING entry to make this clear.
Warner
> .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
> # 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
>
>
>
> By contrast the old bsd.own.mk logic from 10.1-STABLE did not depend on
> testing !${COMPILER_FEATURES:Mc++11} (or analogous) before deciding for
> powerpc/powerpc64...
>
> # 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
> .elif ${__T} == "arm" || ${__T} == "armv6"
> __DEFAULT_YES_OPTIONS+=CLANG
> # 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
> .endif
> # Clang the default system compiler only on little-endian arm and x86.
> .if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
> ${__T} == "i386"
> __DEFAULT_YES_OPTIONS+=CLANG_IS_CC
> # The pc98 bootloader requires gcc to build and so we must leave gcc enabled
> # for pc98 for now.
> .if ${__TT} == "pc98"
> __DEFAULT_NO_OPTIONS+=GNUCXX
> __DEFAULT_YES_OPTIONS+=GCC
> .else
> __DEFAULT_NO_OPTIONS+=GCC GNUCXX
> .endif
> .else
> # If clang is not cc, then build gcc by default
> __DEFAULT_NO_OPTIONS+=CLANG_IS_CC
> __DEFAULT_YES_OPTIONS+=GCC
> # And if g++ is c++, build the rest of the GNU C++ stack
> .if defined(WITHOUT_CXX)
> __DEFAULT_NO_OPTIONS+=GNUCXX
> .else
> __DEFAULT_YES_OPTIONS+=GNUCXX
> .endif
> .endif
>
>
> ===
> Mark Millard
> markmi at dsl-only.net
>
> _______________________________________________
> [email protected] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
> To unsubscribe, send any mail to "[email protected]"
signature.asc
Description: Message signed with OpenPGP using GPGMail
