ports/183956: lang/clang32 update default C++ library to libc++ on FreeBSD 10 and higher
Daniel Peyrolon
dpl at FreeBSD.org
Thu Nov 14 16:40:00 UTC 2013
>Number: 183956
>Category: ports
>Synopsis: lang/clang32 update default C++ library to libc++ on FreeBSD 10 and higher
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Thu Nov 14 16:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: Daniel Peyrolon
>Release: 10-BETA3
>Organization:
>Environment:
>Description:
Apply the clang portion of r255321 from base switching the default C++ library to libc++ on 10+.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
Index: Makefile
===================================================================
--- Makefile (revision 333732)
+++ Makefile (working copy)
@@ -2,7 +2,7 @@
PORTNAME= clang
DISTVERSION= 3.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= lang devel
MASTER_SITES= http://llvm.org/releases/${PORTVERSION}/
PKGNAMESUFFIX= ${LLVM_SUFFIX}
Index: files/patch-tools_clang_lib_Driver_ToolChains.cpp
===================================================================
--- files/patch-tools_clang_lib_Driver_ToolChains.cpp (revision 0)
+++ files/patch-tools_clang_lib_Driver_ToolChains.cpp (working copy)
@@ -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)
Property changes on: files/patch-tools_clang_lib_Driver_ToolChains.cpp
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: files/patch-tools_clang_lib_Driver_ToolChains.h
===================================================================
--- files/patch-tools_clang_lib_Driver_ToolChains.h (revision 0)
+++ files/patch-tools_clang_lib_Driver_ToolChains.h (working copy)
@@ -0,0 +1,20 @@
+
+$FreeBSD$
+
+--- tools/clang/lib/Driver/ToolChains.h.orig
++++ tools/clang/lib/Driver/ToolChains.h
+@@ -463,9 +463,14 @@
+ public:
+ FreeBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Args);
+
++ virtual CXXStdlibType GetCXXStdlibType(const ArgList &Args) const;
++
+ virtual bool IsMathErrnoDefault() const { return false; }
+ virtual bool IsObjCNonFragileABIDefault() const { return true; }
+
++ virtual void AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
++ ArgStringList &CC1Args) const;
++
+ virtual Tool &SelectTool(const Compilation &C, const JobAction &JA,
+ const ActionList &Inputs) const;
+ };
Property changes on: files/patch-tools_clang_lib_Driver_ToolChains.h
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list