From owner-svn-src-all@FreeBSD.ORG Sun Sep 8 20:30:52 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CF1FA6CF; Sun, 8 Sep 2013 20:30:52 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8ED972F96; Sun, 8 Sep 2013 20:30:52 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r88KUlnv090948 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 8 Sep 2013 20:30:48 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r255321 - in head: contrib/llvm/tools/clang/lib/Driver gnu/lib gnu/usr.bin/cc share/mk sys/sys tools/build/options From: David Chisnall In-Reply-To: <86a9jnoynl.fsf@nine.des.no> Date: Sun, 8 Sep 2013 21:30:42 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201309062008.r86K836C048843@svn.freebsd.org> <86a9jnoynl.fsf@nine.des.no> To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, dim@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 08 Sep 2013 20:30:53 -0000 On 8 Sep 2013, at 21:18, Dag-Erling Sm=F8rgrav wrote: > David Chisnall writes: >> Log: >> On platforms where clang is the default compiler, don't build gcc or = libstdc++. >=20 > This uncovers what I think is a bug in bsd.prog.mk: >=20 > des@ds4 /usr/src/usr.bin% make > =3D=3D=3D> alias (all) > =3D=3D=3D> apply (all) > =3D=3D=3D> ar (all) > =3D=3D=3D> asa (all) > =3D=3D=3D> at (all) > =3D=3D=3D> atf (all) > =3D=3D=3D> atf/atf-config (all) > make[2]: /usr/obj/usr/src/usr.bin/atf/atf-config/.depend, 111: = ignoring stale .depend for /usr/obj/usr/src/tmp/usr/lib/libstdc++.a > c++ -O2 -pipe -march=3Dnative -DGDB=3D\"gdb\" -DHAVE_CONFIG_H = -I/usr/src/usr.bin/atf/atf-config/../../../contrib/atf -g = -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall = -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith = -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int = -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality = -Wno-unused-function -Wno-conversion -Wno-c++11-extensions -g -o = atf-config atf-config.o -latf-c++ -latf-c > des@ds4 /usr/src/usr.bin% grep libstdc = /usr/obj/usr/src/usr.bin/atf/atf-config/.depend=20 > atf-config: /usr/obj/usr/src/tmp/usr/lib/libstdc++.a > des@ds4 /usr/src/usr.bin% stat = /usr/obj/usr/src/tmp/usr/lib/libstdc++.a > stat: /usr/obj/usr/src/tmp/usr/lib/libstdc++.a: stat: No such file or = directory >=20 > That line was added by bsd.prog.mk: >=20 > .if defined(PROG_CXX) > .if !empty(CXXFLAGS:M-stdlib=3Dlibc++) > echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} > .else > echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} > .endif > .endif >=20 > AFAICT, this logic should be inverted on platforms where clang is the > default compiler - perhaps like this: >=20 > Index: share/mk/bsd.prog.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/mk/bsd.prog.mk (revision 255393) > +++ share/mk/bsd.prog.mk (working copy) > @@ -173,7 +173,7 @@ > .else > echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} > .if defined(PROG_CXX) > -.if !empty(CXXFLAGS:M-stdlib=3Dlibc++) > +.if ${MK_CLANG_IS_CC} !=3D "no" || !empty(CXXFLAGS:M-stdlib=3Dlibc++) > echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} > .else > echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} >=20 > although this misses the case where CLANG_IS_CC but we still want the > old libstdc++ - is that even possible? This case is possible with -stdlib=3Dlibstdc++, so similar logic should = apply. I think it should say: .if ${MK_CLANG_IS_CC} !=3D "no" && empty(CXXFLAGS:M-stdlib=3Dlibstdc++) echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} .else echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} David