Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2013 01:35:17 +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: r333812 - in head/lang/clang32: . files
Message-ID:  <201311150135.rAF1ZH3n080702@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Fri Nov 15 01:35:17 2013
New Revision: 333812
URL: http://svnweb.freebsd.org/changeset/ports/333812

Log:
  Apply the clang portion of r255321 from base switching the default C++
  library to libc++ on 10+.
  
  PR:		ports/183956
  Submitted by:	dpl

Added:
  head/lang/clang32/files/patch-tools_clang_lib_Driver_ToolChains.cpp   (contents, props changed)
  head/lang/clang32/files/patch-tools_clang_lib_Driver_ToolChains.h   (contents, props changed)
Modified:
  head/lang/clang32/Makefile

Modified: head/lang/clang32/Makefile
==============================================================================
--- head/lang/clang32/Makefile	Fri Nov 15 01:30:05 2013	(r333811)
+++ head/lang/clang32/Makefile	Fri Nov 15 01:35:17 2013	(r333812)
@@ -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}

Added: head/lang/clang32/files/patch-tools_clang_lib_Driver_ToolChains.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/clang32/files/patch-tools_clang_lib_Driver_ToolChains.cpp	Fri Nov 15 01:35:17 2013	(r333812)
@@ -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)

Added: head/lang/clang32/files/patch-tools_clang_lib_Driver_ToolChains.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/clang32/files/patch-tools_clang_lib_Driver_ToolChains.h	Fri Nov 15 01:35:17 2013	(r333812)
@@ -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;
+ };



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311150135.rAF1ZH3n080702>