Date: Wed, 6 Nov 2013 23:38:36 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r333046 - in head/lang/clang33: . files Message-ID: <201311062338.rA6NcaXl098362@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Wed Nov 6 23:38:36 2013 New Revision: 333046 URL: http://svnweb.freebsd.org/changeset/ports/333046 Log: Apply the clang portion of r255321 from base switching the default C++ library to libc++ on 10+. Requested by: tijl Added: head/lang/clang33/files/patch-tools_clang_lib_Driver_ToolChains.cpp - copied unchanged from r333045, head/lang/clang-devel/files/patch-tools_clang_lib_Driver_ToolChains.cpp head/lang/clang33/files/patch-tools_clang_lib_Driver_ToolChains.h - copied, changed from r333045, head/lang/clang-devel/files/patch-tools_clang_lib_Driver_ToolChains.h Modified: head/lang/clang33/Makefile Modified: head/lang/clang33/Makefile ============================================================================== --- head/lang/clang33/Makefile Wed Nov 6 22:50:21 2013 (r333045) +++ head/lang/clang33/Makefile Wed Nov 6 23:38:36 2013 (r333046) @@ -2,7 +2,7 @@ PORTNAME= clang DISTVERSION= 3.3 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= lang devel MASTER_SITES= http://llvm.org/releases/${PORTVERSION}/ PKGNAMESUFFIX= ${LLVM_SUFFIX} Copied: head/lang/clang33/files/patch-tools_clang_lib_Driver_ToolChains.cpp (from r333045, head/lang/clang-devel/files/patch-tools_clang_lib_Driver_ToolChains.cpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/clang33/files/patch-tools_clang_lib_Driver_ToolChains.cpp Wed Nov 6 23:38:36 2013 (r333046, copy of r333045, head/lang/clang-devel/files/patch-tools_clang_lib_Driver_ToolChains.cpp) @@ -0,0 +1,44 @@ + +$FreeBSD$ + +--- tools/clang/lib/Driver/ToolChains.cpp.orig ++++ tools/clang/lib/Driver/ToolChains.cpp +@@ -1950,6 +1950,38 @@ + } + } + ++ToolChain::CXXStdlibType ++FreeBSD::GetCXXStdlibType(const ArgList &Args) const { ++ if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) { ++ StringRef Value = A->getValue(); ++ if (Value == "libc++") ++ return ToolChain::CST_Libcxx; ++ if (Value == "libstdc++") ++ return ToolChain::CST_Libstdcxx; ++ getDriver().Diag(diag::err_drv_invalid_stdlib_name) ++ << A->getAsString(Args); ++ } ++ ++ return getTriple().getOSMajorVersion() >= 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) == 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. + + NetBSD::NetBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) Copied and modified: head/lang/clang33/files/patch-tools_clang_lib_Driver_ToolChains.h (from r333045, head/lang/clang-devel/files/patch-tools_clang_lib_Driver_ToolChains.h) ============================================================================== --- head/lang/clang-devel/files/patch-tools_clang_lib_Driver_ToolChains.h Wed Nov 6 22:50:21 2013 (r333045, copy source) +++ head/lang/clang33/files/patch-tools_clang_lib_Driver_ToolChains.h Wed Nov 6 23:38:36 2013 (r333046) @@ -5,15 +5,15 @@ $FreeBSD$ +++ tools/clang/lib/Driver/ToolChains.h @@ -515,9 +515,14 @@ FreeBSD(const Driver &D, const llvm::Triple &Triple, - const llvm::opt::ArgList &Args); + const ArgList &Args); -+ virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const; ++ virtual CXXStdlibType GetCXXStdlibType(const ArgList &Args) const; + virtual bool IsMathErrnoDefault() const { return false; } virtual bool IsObjCNonFragileABIDefault() const { return true; } -+ virtual void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs, -+ llvm::opt::ArgStringList &CC1Args) const; ++ virtual void AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, ++ ArgStringList &CC1Args) const; + virtual bool UseSjLjExceptions() const; protected:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311062338.rA6NcaXl098362>