From owner-freebsd-toolchain@FreeBSD.ORG Thu Mar 12 09:36:55 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BA46834 for ; Thu, 12 Mar 2015 09:36:55 +0000 (UTC) Received: from asp.reflexion.net (outbound-241.asp.reflexion.net [69.84.129.241]) (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 14C2AAE1 for ; Thu, 12 Mar 2015 09:36:54 +0000 (UTC) Received: (qmail 8161 invoked from network); 12 Mar 2015 09:36:53 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 12 Mar 2015 09:36:53 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.40.1) with SMTP; Thu, 12 Mar 2015 05:36:53 -0400 (EDT) Received: (qmail 31772 invoked from network); 12 Mar 2015 09:36:52 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (DHE-RSA-AES256-SHA encrypted) SMTP; 12 Mar 2015 09:36:52 -0000 X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-67-189-19-145.hsd1.or.comcast.net [67.189.19.145]) by iron2.pdx.net (Postfix) with ESMTPSA id E3DA51C439E; Thu, 12 Mar 2015 02:36:50 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: 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 Message-Id: Date: Thu, 12 Mar 2015 02:36:50 -0700 To: FreeBSD PowerPC ML , freebsd-toolchain@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) X-Mailer: Apple Mail (2.2070.6) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 09:36:55 -0000 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-NODEBU= G powerpc As COMPILER_FEATURES context first I note that bsd.compiler.mk uses the = rule... .if ${COMPILER_TYPE} =3D=3D "clang" || \ (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D = 40800) COMPILER_FEATURES=3D c++11 .else COMPILER_FEATURES=3D .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+=3DGCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=3DCLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC .elif ${__T} =3D=3D "amd64" || ${__T} =3D=3D "i386" # On x86, clang is enabled, and will be installed as the default cc. __DEFAULT_YES_OPTIONS+=3DCLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC __DEFAULT_NO_OPTIONS+=3DGCC GCC_BOOTSTRAP GNUCXX .elif ${__TT} =3D=3D "arm" && ${__T:Marm*eb*} =3D=3D "" # 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+=3DCLANG CLANG_BOOTSTRAP CLANG_IS_CC __DEFAULT_NO_OPTIONS+=3DCLANG_FULL GCC GCC_BOOTSTRAP GNUCXX .elif ${__T:Mpowerpc*} # On powerpc, clang is enabled, but gcc is installed as the default cc. __DEFAULT_YES_OPTIONS+=3DCLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=3DCLANG_BOOTSTRAP CLANG_IS_CC .else # Everything else disables clang, and uses gcc instead. __DEFAULT_YES_OPTIONS+=3DGCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=3DCLANG 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} =3D=3D "amd64" || ${__T} =3D=3D "i386" || ${__T:Mpowerpc*} __DEFAULT_YES_OPTIONS+=3DCLANG CLANG_FULL .elif ${__T} =3D=3D "arm" || ${__T} =3D=3D "armv6" __DEFAULT_YES_OPTIONS+=3DCLANG # GCC is unable to build the full clang on arm, disable it by default. __DEFAULT_NO_OPTIONS+=3DCLANG_FULL .else __DEFAULT_NO_OPTIONS+=3DCLANG CLANG_FULL .endif # Clang the default system compiler only on little-endian arm and x86. .if ${__T} =3D=3D "amd64" || ${__T} =3D=3D "arm" || ${__T} =3D=3D = "armv6" || \ ${__T} =3D=3D "i386" __DEFAULT_YES_OPTIONS+=3DCLANG_IS_CC # The pc98 bootloader requires gcc to build and so we must leave gcc = enabled # for pc98 for now. .if ${__TT} =3D=3D "pc98" __DEFAULT_NO_OPTIONS+=3DGNUCXX __DEFAULT_YES_OPTIONS+=3DGCC .else __DEFAULT_NO_OPTIONS+=3DGCC GNUCXX .endif .else # If clang is not cc, then build gcc by default __DEFAULT_NO_OPTIONS+=3DCLANG_IS_CC __DEFAULT_YES_OPTIONS+=3DGCC # And if g++ is c++, build the rest of the GNU C++ stack .if defined(WITHOUT_CXX) __DEFAULT_NO_OPTIONS+=3DGNUCXX .else __DEFAULT_YES_OPTIONS+=3DGNUCXX .endif .endif =3D=3D=3D Mark Millard markmi at dsl-only.net