Date: Fri, 6 Sep 2013 21:43:01 +0100 From: David Chisnall <theraven@FreeBSD.org> To: Xin LI <delphij@gmail.com> Cc: "svn-src-head@freebsd.org" <svn-src-head@FreeBSD.org>, "svn-src-all@freebsd.org" <svn-src-all@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org> 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 Message-ID: <C1E72847-DC2D-49C2-9715-3A2CE74EC53D@FreeBSD.org> In-Reply-To: <CAGMYy3sypEMfqbASezvSwHPGJnzQBLsHHEpEQ9nou2ahB=c1uw@mail.gmail.com> References: <201309062008.r86K836C048843@svn.freebsd.org> <CAGMYy3sypEMfqbASezvSwHPGJnzQBLsHHEpEQ9nou2ahB=c1uw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for the report. I've now bracketed the extra flag in a check = that we're compiling with clang, which should fix it, so let me know if = it still breaks for you. David On 6 Sep 2013, at 21:34, Xin LI <delphij@gmail.com> wrote: > Will this break cross building on 9.x host? I hit this: >=20 > c++ -O2 -pipe = -I/tank/home/delphij/head/lib/clang/libllvmsupport/../../../contrib/llvm/i= nclude > = -I/tank/home/delphij/head/lib/clang/libllvmsupport/../../../contrib/llvm/t= ools/clang/include > = -I/tank/home/delphij/head/lib/clang/libllvmsupport/../../../contrib/llvm/l= ib/Support > -I. = -I/tank/home/delphij/head/lib/clang/libllvmsupport/../../../contrib/llvm/.= ./../lib/clang/include > -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS > -D__STDC_CONSTANT_MACROS -fno-strict-aliasing > -DLLVM_DEFAULT_TARGET_TRIPLE=3D\"x86_64-unknown-freebsd10.0\" > -DLLVM_HOST_TRIPLE=3D\"x86_64-unknown-freebsd10.0\" > -DDEFAULT_SYSROOT=3D\"\" > -I/tank/home/delphij/obj/tank/home/delphij/head/tmp/legacy/usr/include > -Wno-c++11-extensions -fno-exceptions -fno-rtti -c > = /tank/home/delphij/head/lib/clang/libllvmsupport/../../../contrib/llvm/lib= /Support/APFloat.cpp > -o APFloat.o > cc1plus: error: unrecognized command line option = "-Wno-c++11-extensions" >=20 > On Fri, Sep 6, 2013 at 1:08 PM, David Chisnall <theraven@freebsd.org> = wrote: >> Author: theraven >> Date: Fri Sep 6 20:08:03 2013 >> New Revision: 255321 >> URL: http://svnweb.freebsd.org/changeset/base/255321 >>=20 >> Log: >> On platforms where clang is the default compiler, don't build gcc or = libstdc++. >> To enable them, set WITH_GCC and WITH_GNUCXX in src.conf. >> Make clang default to using libc++ on FreeBSD 10. >> Bumped __FreeBSD_version for the change. >>=20 >> GCC is still enabled on PC98, because the PC98 bootloader requires = GCC to build >> (or, at least, hard-codes the use of gcc into its build). >>=20 >> Thanks to everyone who helped make the ports tree ready for this = (and bapt >> for coordinating them all). Also to imp for reviewing this and = working on the >> forward-porting of the changes in our gcc so that we're getting to a = much >> better place with regard to external toolchains. >>=20 >> Sorry to all of the people who helped who I forgot to mention by = name. >>=20 >> Reviewed by: bapt, imp, dim, ... >>=20 >> Added: >> head/tools/build/options/WITHOUT_GNUCXX (contents, props changed) >> head/tools/build/options/WITH_GNUCXX (contents, props changed) >> Modified: >> head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp >> head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h >> head/gnu/lib/Makefile >> head/gnu/usr.bin/cc/Makefile >> head/share/mk/bsd.own.mk >> head/sys/sys/param.h >>=20 >> Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp >> = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Fri = Sep 6 18:41:57 2013 (r255320) >> +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Fri = Sep 6 20:08:03 2013 (r255321) >> @@ -1851,6 +1851,38 @@ bool FreeBSD::UseSjLjExceptions() const >> } >> } >>=20 >> +ToolChain::CXXStdlibType >> +FreeBSD::GetCXXStdlibType(const ArgList &Args) const { >> + if (Arg *A =3D Args.getLastArg(options::OPT_stdlib_EQ)) { >> + StringRef Value =3D A->getValue(); >> + if (Value =3D=3D "libc++") >> + return ToolChain::CST_Libcxx; >> + if (Value =3D=3D "libstdc++") >> + return ToolChain::CST_Libstdcxx; >> + getDriver().Diag(diag::err_drv_invalid_stdlib_name) >> + << A->getAsString(Args); >> + } >> + >> + return getTriple().getOSMajorVersion() >=3D 10 ? = ToolChain::CST_Libcxx : >> + ToolChain::CST_Libstdcxx; >> +} >> + >> +void FreeBSD::AddClangCXXStdlibIncludeArgs(const ArgList = &DriverArgs, >> + ArgStringList &CC1Args) = const { >> + if (DriverArgs.hasArg(options::OPT_nostdlibinc) || >> + DriverArgs.hasArg(options::OPT_nostdincxx)) >> + return; >> + >> + if (GetCXXStdlibType(DriverArgs) =3D=3D ToolChain::CST_Libcxx) >> + addSystemInclude(DriverArgs, CC1Args, >> + getDriver().SysRoot + "/usr/include/c++/v1"); >> + else >> + addSystemInclude(DriverArgs, CC1Args, >> + getDriver().SysRoot + "/usr/include/c++/4.2"); >> + return; >> + >> +} >> + >> /// NetBSD - NetBSD tool chain which can call as(1) and ld(1) = directly. >>=20 >> NetBSD::NetBSD(const Driver &D, const llvm::Triple& Triple, const = ArgList &Args) >>=20 >> Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h >> = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Fri = Sep 6 18:41:57 2013 (r255320) >> +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Fri = Sep 6 20:08:03 2013 (r255321) >> @@ -458,9 +458,14 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : >> public: >> FreeBSD(const Driver &D, const llvm::Triple& Triple, const ArgList = &Args); >>=20 >> + virtual CXXStdlibType GetCXXStdlibType(const ArgList &Args) const; >> + >> virtual bool IsMathErrnoDefault() const { return false; } >> virtual bool IsObjCNonFragileABIDefault() const { return true; } >>=20 >> + virtual void AddClangCXXStdlibIncludeArgs(const ArgList = &DriverArgs, >> + ArgStringList &CC1Args) = const; >> + >> virtual bool UseSjLjExceptions() const; >> protected: >> virtual Tool *buildAssembler() const; >>=20 >> Modified: head/gnu/lib/Makefile >> = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/gnu/lib/Makefile Fri Sep 6 18:41:57 2013 = (r255320) >> +++ head/gnu/lib/Makefile Fri Sep 6 20:08:03 2013 = (r255321) >> @@ -10,7 +10,7 @@ SUBDIR+=3D libssp >>=20 >> # libsupc++ uses libstdc++ headers, although 'make includes' should >> # have taken care of that already. >> -.if ${MK_CXX} !=3D "no" >> +.if ${MK_GNUCXX} !=3D "no" >> SUBDIR+=3D libstdc++ libsupc++ >> .endif >>=20 >>=20 >> Modified: head/gnu/usr.bin/cc/Makefile >> = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/gnu/usr.bin/cc/Makefile Fri Sep 6 18:41:57 2013 = (r255320) >> +++ head/gnu/usr.bin/cc/Makefile Fri Sep 6 20:08:03 2013 = (r255321) >> @@ -12,7 +12,12 @@ SUBDIR+=3D cpp >> .endif >>=20 >> .if ${MK_CXX} !=3D "no" >> -SUBDIR+=3D cc1plus c++ c++filt >> +.if ${MK_GNUCXX} !=3D "no" >> +SUBDIR+=3D cc1plus c++ >> +.endif >> +# This should be moved into the above block once c++filt from = elftoolchain or >> +# similar is provided. >> +SUBDIR+=3D c++filt >> .endif >>=20 >> .if ${MK_GCOV} !=3D "no" >>=20 >> Modified: head/share/mk/bsd.own.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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/share/mk/bsd.own.mk Fri Sep 6 18:41:57 2013 = (r255320) >> +++ head/share/mk/bsd.own.mk Fri Sep 6 20:08:03 2013 = (r255321) >> @@ -284,7 +284,6 @@ __DEFAULT_YES_OPTIONS =3D \ >> FP_LIBC \ >> FREEBSD_UPDATE \ >> GAMES \ >> - GCC \ >> GCOV \ >> GDB \ >> GNU \ >> @@ -400,6 +399,11 @@ __T=3D${TARGET_ARCH} >> .else >> __T=3D${MACHINE_ARCH} >> .endif >> +.if defined(TARGET) >> +__TT=3D${TARGET} >> +.else >> +__TT=3D${MACHINE_ARCH} >> +.endif >> # 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 >> @@ -414,8 +418,30 @@ __DEFAULT_NO_OPTIONS+=3DCLANG CLANG_FULL >> .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 >> +# The libc++ headers use c++11 extensions. These are normally = silenced because >> +# they are treated as system headers, but we explicitly disable that = warning >> +# suppression when building the base system to catch bugs in our = headers. >> +# Eventually we'll want to start building the base system C++ code = as C++11, >> +# but not yet. >> +CXXFLAGS+=3D -Wno-c++11-extensions >> .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 >> # FDT is needed only for arm, mips and powerpc >> .if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*} >>=20 >> Modified: head/sys/sys/param.h >> = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/sys/param.h Fri Sep 6 18:41:57 2013 = (r255320) >> +++ head/sys/sys/param.h Fri Sep 6 20:08:03 2013 = (r255321) >> @@ -58,7 +58,7 @@ >> * in the range 5 to 9. >> */ >> #undef __FreeBSD_version >> -#define __FreeBSD_version 1000053 /* Master, propagated to = newvers */ >> +#define __FreeBSD_version 1000054 /* Master, propagated to = newvers */ >>=20 >> /* >> * __FreeBSD_kernel__ indicates that this system uses the kernel of = FreeBSD, >>=20 >> Added: head/tools/build/options/WITHOUT_GNUCXX >> = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/tools/build/options/WITHOUT_GNUCXX Fri Sep 6 20:08:03 = 2013 (r255321) >> @@ -0,0 +1,3 @@ >> +.\" $FreeBSD$ >> +Do not build the GNU C++ stack (g++, libstdc++). >> +This is the default on platforms where clang is the system compiler. >>=20 >> Added: head/tools/build/options/WITH_GNUCXX >> = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/tools/build/options/WITH_GNUCXX Fri Sep 6 20:08:03 = 2013 (r255321) >> @@ -0,0 +1,3 @@ >> +.\" $FreeBSD$ >> +Build the GNU C++ stack (g++, libstdc++). >> +This is the default on platforms where gcc is the system compiler. >=20 >=20 >=20 > --=20 > Xin LI <delphij@delphij.net> https://www.delphij.net/ > FreeBSD - The Power to Serve! Live free or die
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C1E72847-DC2D-49C2-9715-3A2CE74EC53D>