Re: powerpc/powerpc64 11.0-CURRENT not building clang by default: src.opt.mk not equivalent to 10.1-STABLE bsd.own.mk on the issue
Nathan W. wrote: > This is not the right one. That is related to clang 3.4. The issue is > that clang 3.5+ require a C++11 compiler to build. ... The text that I quoted is from the 11.0-CURRENT UPDATING entry that starts with the non-FreeBSD-variant-specific 3.5.0 background information below. May be I originally should not have only extracted the material I thought fit best for being instructions for powerpc64 10.x: i.e., I should have given more context. For future readers, quoting more UPDATING context this time... > 20141231: > Clang, llvm and lldb have been upgraded to 3.5.0 release. > > As of this release, a prerequisite for building clang, llvm and lldb > is > a C++11 capable compiler and C++11 standard library. This means that > to > be able to successfully build the cross-tools stage of buildworld, > with > clang as the bootstrap compiler, your system compiler or cross > compiler > should either be clang 3.3 or later, or gcc 4.8 or later, and your > system C++ library should be libc++, or libdstdc++ from gcc 4.8 or > later. The later FreeBSD-variants-specific material makes for a complicated to read entry for powerpc/powerpc64 10.x. Why? Paragraph by paragraph for the next couple of paragraphs that follow the above... > On any standard FreeBSD 10.x or 11.x installation, where clang and > libc++ are on by default (that is, on x86 or arm), this should work > out > of the box. "where clang and libc++ are on by default": the libc++ part excludes powerpc/powerpc64 10.x. The 3.4.1 status for clang is not sufficient here, despite being after 3.3. > On 9.x installations where clang is enabled by default, e.g. on x86 > and > powerpc, libc++ will not be enabled by default, so libc++ should be > built (with clang) and installed first. If both clang and libc++ are > missing, build clang first, then use it to build libc++. The "9.x" wording above makes no mention of 10.x but powerpc/powerpc64 10.x also has clang without having libc++ enabled by default. (Nor the libcxxrt that libc++ requires.) The instructions from here seem to be the ones that would apply (and likely do for powerpc64 --but not for powerpc as stands, see later). After that is 8.x, Sparc64, and mips notes that are not a match to the powerpc/powerpc64 10.x context --and embedded system notes about cross builds: > On 8.x and earlier installations, upgrade to 9.x first, and then > follow > the instructions for 9.x above. > > Sparc64 and mips users are unaffected, as they still use gcc 4.2.1 by > default, and do not build clang. > > Many embedded systems are resource constrained, and will not be able > to > build clang in a reasonable time, or in some cases at all. In those > cases, cross building bootable systems on amd64 is a workaround. Taken literally no paragraph explicitly covers powerpc/powerpc64 10.x contexts for how to bootstrap to have clang present in 11.0-CURRENT. By content the one starting with "On 9.x" is the closest match for powerpc/powerpc64 10.x. My variant text with []'s might better have been: On 9.x installations where clang is enabled by default, e.g. on x86 and powerpc [10.x too], libc++ will not be enabled by default, so libc++ should be built (with clang) and installed first. If both clang and libc++ are missing, build clang first, then use it to build libc++. That would avoid odd implications for the combination x86 and 10.x by being explicitly localized to powerpc for the 10.x part. But for powerpc (on-64) 10.1-STABLE even that adjustment would be wrong/incomplete... powerpc 10.1-STABLE (3.4.1 clang present) does not build libcxxrt: > ... > building shared library libcxxrt.so.1 > /usr/bin/ld: warning: creating a DT_TEXTREL in a shared object. > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > *** Error code 1 That in turn means libc++'s build fails from the missing libcxxrt file that libc++'s build uses in its linking step. That would make it rather hard to follow the instructions. powerpc64 10.1-STABLE had no such problems building and installing those two libraries. === Mark Millard markmi at dsl-only.net On 2015-Mar-12, at 10:01 AM, Mark Millard wrote: Well there is an entry but when I read it I did not find it clear about the 10.x status. I think the implication is that the 9.x paragraph also applies to 10.x: On 9.x [and 10.x] installations where clang is enabled by default, e.g. on x86 and powerpc, libc++ will not be enabled by default, so libc++ should be built (with clang) and installed first. If both clang and libc++ are missing, build clang first, then use it to build libc++. === Mark Millard markmi at dsl-only.net ___ freebsd-too
Re: powerpc/powerpc64 11.0-CURRENT not building clang by default: src.opt.mk not equivalent to 10.1-STABLE bsd.own.mk on the issue
Well there is an entry but when I read it I did not find it clear about the 10.x status. I think the implication is that the 9.x paragraph also applies to 10.x: On 9.x [and 10.x] installations where clang is enabled by default, e.g. on x86 and powerpc, libc++ will not be enabled by default, so libc++ should be built (with clang) and installed first. If both clang and libc++ are missing, build clang first, then use it to build libc++. === Mark Millard mar...@dsl-only.net On 2015-Mar-12, at 05:00 AM, Warner Losh wrote: > On Mar 12, 2015, at 6:36 PM, Mark Millard 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 > .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 > > ___ > freebsd-toolchain@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org" ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"
Re: powerpc/powerpc64 11.0-CURRENT not building clang by default: src.opt.mk not equivalent to 10.1-STABLE bsd.own.mk on the issue
This is not the right one. That is related to clang 3.4. The issue is that clang 3.5+ require a C++11 compiler to build. GCC 4.2 is not a C++11 compiler and so the clang build was disabled. This makes the upgrade path when clang becomes the default compiler a little bumpy, but that did not seem to be a reason to hold off on the 3.5 upgrade across the board. -Nathan On 03/12/15 10:01, Mark Millard wrote: Well there is an entry but when I read it I did not find it clear about the 10.x status. I think the implication is that the 9.x paragraph also applies to 10.x: On 9.x [and 10.x] installations where clang is enabled by default, e.g. on x86 and powerpc, libc++ will not be enabled by default, so libc++ should be built (with clang) and installed first. If both clang and libc++ are missing, build clang first, then use it to build libc++. === Mark Millard mar...@dsl-only.net On 2015-Mar-12, at 05:00 AM, Warner Losh wrote: On Mar 12, 2015, at 6:36 PM, Mark Millard 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 .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 ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org" ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To un
Re: powerpc/powerpc64 11.0-CURRENT not building clang by default: src.opt.mk not equivalent to 10.1-STABLE bsd.own.mk on the issue
> On Mar 12, 2015, at 6:36 PM, Mark Millard 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 > .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 > > ___ > freebsd-toolchain@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org" signature.asc Description: Message signed with OpenPGP using GPGMail
powerpc/powerpc64 11.0-CURRENT not building clang by default: src.opt.mk not equivalent to 10.1-STABLE bsd.own.mk on the issue
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... .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} == "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 ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"
powerpc/powerpc64 11.0-CURRENT not building clang by default: src.opt.mk not equivalent to 10.1-STABLE bsd.own.mk on the issue
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... .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} == "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 ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"