<pre style='margin:0'>
Marcus Calhoun-Lopez (MarcusCalhoun-Lopez) pushed a commit to branch master
in repository macports-ports.

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/c79d736b4cc51f1f9fbea598382ef4960f05b316">https://github.com/macports/macports-ports/commit/c79d736b4cc51f1f9fbea598382ef4960f05b316</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit c79d736b4cc51f1f9fbea598382ef4960f05b316
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Sun Oct 1 10:19:39 2017 -0700

<span style='display:block; white-space:pre;color:#404040;'>    clang-*, gcc7: remove libgcc as a clang dependency
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    * libgcc installs GCC c++ header files.
</span><span style='display:block; white-space:pre;color:#404040;'>    * clang++-mp-* -stdlib=macports-libstdc++ looks for libgcc first.
</span><span style='display:block; white-space:pre;color:#404040;'>     * If libgcc is installed, it is used.
</span><span style='display:block; white-space:pre;color:#404040;'>     * If libgcc is NOT installed, the system libstdc++ is used.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    See https://trac.macports.org/ticket/54773
</span><span style='display:block; white-space:pre;color:#404040;'>    Fixes https://trac.macports.org/ticket/54766
</span>---
 _resources/port1.0/group/cxx11-1.1.tcl             |   3 +
 lang/gcc7/Portfile                                 |  12 +-
 lang/llvm-3.9/Portfile                             |   7 +-
 lang/llvm-3.9/files/9001-macports-libstdcxx.diff   |  40 +++---
 lang/llvm-4.0/Portfile                             |   5 +-
 lang/llvm-4.0/files/9001-macports-libstdcxx.diff   |  42 +++---
 lang/llvm-5.0/Portfile                             |   5 +-
 lang/llvm-5.0/files/9001-macports-libstdcxx.diff   | 145 ++++++++++-----------
 lang/llvm-devel/Portfile                           |  31 +++--
 lang/llvm-devel/files/9001-macports-libstdcxx.diff | 145 ++++++++++-----------
 10 files changed, 200 insertions(+), 235 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/cxx11-1.1.tcl b/_resources/port1.0/group/cxx11-1.1.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 396ec0b..5553140 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/cxx11-1.1.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/cxx11-1.1.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -46,6 +46,9 @@ if {${cxx_stdlib} eq "libstdc++" } {
</span>     # see https://trac.macports.org/ticket/53194
     configure.cxx_stdlib macports-libstdc++
     
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    # see https://trac.macports.org/ticket/54766
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    depends_lib-append port:libgcc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span>     platform darwin powerpc {
         # ports will build on powerpc with gcc6, gcc4ABI-compatible
         
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/gcc7/Portfile b/lang/gcc7/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 556deb0..25a0db8 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/gcc7/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/gcc7/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,7 @@ PortGroup select 1.0
</span> PortGroup compiler_blacklist_versions 1.0
 
 name                gcc7
<span style='display:block; white-space:pre;background:#ffe0e0;'>-subport             libgcc {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport             libgcc { revision 1 }
</span> 
 epoch               2
 version             7.2.0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -172,6 +172,15 @@ if {${subport} eq "libgcc"} {
</span>         --libdir=${prefix}/lib/${name} \
         --libdir=${prefix}/lib/libgcc
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    # see https://trac.macports.org/ticket/54766
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    configure.args-replace \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        --includedir=${prefix}/include/${name} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        --includedir=${prefix}/include/gcc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    configure.args-replace \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        --with-gxx-include-dir=${prefix}/include/gcc/c++/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span>     # TODO: Possibly disable bootstrap with appropriate configure flags.
     #       the problem is that libstdc++'s configure script tests for tls support
     #       using the running compiler (not gcc for which libstdc++ is being built).
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -220,7 +229,6 @@ if {${subport} eq "libgcc"} {
</span> 
         file delete -force ${destroot}${prefix}/bin
         file delete -force ${destroot}${prefix}/share
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        file delete -force ${destroot}${prefix}/include
</span>         file delete -force ${destroot}${prefix}/lib/libgcc
         file delete -force ${destroot}${prefix}/libexec
 
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/Portfile b/lang/llvm-3.9/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 1f22938..1499691 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.9/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -11,7 +11,7 @@ set llvm_version        3.9
</span> set llvm_version_no_dot 39
 name                    llvm-${llvm_version}
 revision                4
<span style='display:block; white-space:pre;background:#ffe0e0;'>-subport                 clang-${llvm_version} { revision 5 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport                 clang-${llvm_version} { revision 6 }
</span> set suffix              mp-${llvm_version}
 set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
 dist_subdir             llvm
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -439,12 +439,11 @@ if {${subport} eq "llvm-${llvm_version}"} {
</span>     }
 
     variant libstdcxx description {-stdlib=macports-libstdc++ searches for MacPorts libstdc++} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        depends_lib-append port:gcc6
</span> 
         patchfiles-append 9001-macports-libstdcxx.diff
 
         post-patch {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc6/c++|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc/c++|g" \
</span>                 ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
             reinplace "s|@@MACPORTS_HOST_NAME@@|${build_arch}-apple-darwin${os.major}|g" \
                 ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -493,7 +492,7 @@ if {${subport} eq "llvm-${llvm_version}"} {
</span>                 ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
         }
     }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    #default_variants +libstdcxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    default_variants +libstdcxx
</span> 
     post-patch {
         reinplace "s|@@PREFIX@@|${prefix}|" \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/9001-macports-libstdcxx.diff b/lang/llvm-3.9/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index 010e38e..bd239ff 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.9/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -35,7 +35,7 @@
</span>  #endif
  }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -362,20 +362,31 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -362,6 +362,11 @@
</span>  
      case llvm::Triple::ppc:
      case llvm::Triple::ppc64:
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -43,30 +43,21 @@
</span> +        AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@",
 +                                    "@@MACPORTS_HOST_NAME@@", "@@MACPORTS_GCC_SUBDIRECTORY_ppc@@", "@@MACPORTS_GCC_SUBDIRECTORY_ppc64@@",
 +                                    triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+      } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      }
</span>        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
                                    "powerpc-apple-darwin10", "", "ppc64",
                                    triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-       AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   "powerpc-apple-darwin8", "", "ppc64",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   triple);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-       break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -372,6 +377,10 @@
</span>  
      case llvm::Triple::x86:
      case llvm::Triple::x86_64:
 +      if (HSOpts.UseMacPortsLibstdcxx) {
 +        AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@",
 +                                    "@@MACPORTS_HOST_NAME@@", "@@MACPORTS_GCC_SUBDIRECTORY_i386@@", "@@MACPORTS_GCC_SUBDIRECTORY_x86_64@@", triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+      } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      }
</span>        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
                                    "i686-apple-darwin10", "", "x86_64", triple);
        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   "i686-apple-darwin8", "", "x86_64", triple);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-       break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     case llvm::Triple::arm:
</span> --- orig/tools/clang/include/clang/Driver/ToolChain.h     2016-06-16 03:36:09.000000000 -0700
 +++ new/tools/clang/include/clang/Driver/ToolChain.h   2017-01-04 18:08:42.000000000 -0700
 @@ -51,7 +51,8 @@
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -80,26 +71,25 @@
</span>  
    enum RuntimeLibType {
 --- orig/tools/clang/lib/Driver/ToolChains.cpp 2016-11-23 14:25:50.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ new/tools/clang/lib/Driver/ToolChains.cpp   2017-01-04 20:52:25.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -773,6 +773,13 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     // Otherwise, let the linker search.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Driver/ToolChains.cpp      2017-09-23 20:52:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -741,6 +741,12 @@
</span>      break;
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   case ToolChain::CST_Libstdcxx:
</span> +  case ToolChain::CST_MacPortsLibstdcxx:
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+    if (getVFS().exists("@@MACPORTS_libstdc++@@")) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    if (Type==ToolChain::CST_MacPortsLibstdcxx && getVFS().exists("@@MACPORTS_libstdc++@@")) {
</span> +      CmdArgs.push_back("@@MACPORTS_libstdc++@@");
 +      return;
 +    }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+    CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3015,6 +3022,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // Unfortunately, -lstdc++ doesn't always exist in the standard search path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // it was previously found in the gcc lib dir. However, for all the Darwin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // platforms we care about it was -lstdc++.6, so we search for that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3015,6 +3021,8 @@
</span>      return ToolChain::CST_Libstdcxx;
  
    StringRef Value = A->getValue();
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+  if (Value == "macports-libstdc++" )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  if (Value == "macports-libstdc++")
</span> +      return ToolChain::CST_MacPortsLibstdcxx;
    if (Value != "libstdc++")
      getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-4.0/Portfile b/lang/llvm-4.0/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index a9569b4..e46e69b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-4.0/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-4.0/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -13,7 +13,7 @@ set clang_executable_version 4.0
</span> set lldb_executable_version 4.0.1
 name                    llvm-${llvm_version}
 revision                1
<span style='display:block; white-space:pre;background:#ffe0e0;'>-subport                 clang-${llvm_version} { revision 1 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport                 clang-${llvm_version} { revision 2 }
</span> subport                 lldb-${llvm_version} {}
 set suffix              mp-${llvm_version}
 set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -556,12 +556,11 @@ if {${subport} eq "llvm-${llvm_version}"} {
</span>     }
 
     variant libstdcxx description {-stdlib=macports-libstdc++ searches for MacPorts libstdc++} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        depends_lib-append port:gcc6
</span> 
         patchfiles-append 9001-macports-libstdcxx.diff
 
         post-patch {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc6/c++|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc/c++|g" \
</span>                 ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
             reinplace "s|@@MACPORTS_HOST_NAME@@|${build_arch}-apple-darwin${os.major}|g" \
                 ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-4.0/files/9001-macports-libstdcxx.diff b/lang/llvm-4.0/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index 8900a30..deed711 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-4.0/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-4.0/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,7 +12,7 @@
</span>  
 --- orig/tools/clang/lib/Frontend/CompilerInvocation.cpp       2016-07-13 15:32:15.000000000 -0700
 +++ new/tools/clang/lib/Frontend/CompilerInvocation.cpp        2017-01-04 17:52:18.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1407,8 +1407,10 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1414,8 +1414,10 @@
</span>    Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc);
    Opts.UseStandardSystemIncludes = !Args.hasArg(OPT_nostdsysteminc);
    Opts.UseStandardCXXIncludes = !Args.hasArg(OPT_nostdincxx);
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -35,7 +35,7 @@
</span>  #endif
  }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -361,20 +361,31 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -361,6 +361,11 @@
</span>  
      case llvm::Triple::ppc:
      case llvm::Triple::ppc64:
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -43,30 +43,21 @@
</span> +        AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@",
 +                                    "@@MACPORTS_HOST_NAME@@", "@@MACPORTS_GCC_SUBDIRECTORY_ppc@@", "@@MACPORTS_GCC_SUBDIRECTORY_ppc64@@",
 +                                    triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+      } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      }
</span>        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
                                    "powerpc-apple-darwin10", "", "ppc64",
                                    triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-       AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   "powerpc-apple-darwin8", "", "ppc64",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   triple);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-       break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -371,6 +376,10 @@
</span>  
      case llvm::Triple::x86:
      case llvm::Triple::x86_64:
 +      if (HSOpts.UseMacPortsLibstdcxx) {
 +        AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@",
 +                                    "@@MACPORTS_HOST_NAME@@", "@@MACPORTS_GCC_SUBDIRECTORY_i386@@", "@@MACPORTS_GCC_SUBDIRECTORY_x86_64@@", triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+      } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      }
</span>        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
                                    "i686-apple-darwin10", "", "x86_64", triple);
        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   "i686-apple-darwin8", "", "x86_64", triple);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-       break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     case llvm::Triple::arm:
</span> --- orig/tools/clang/include/clang/Driver/ToolChain.h     2016-06-16 03:36:09.000000000 -0700
 +++ new/tools/clang/include/clang/Driver/ToolChain.h   2017-01-04 18:08:42.000000000 -0700
 @@ -52,7 +52,8 @@
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -80,26 +71,25 @@
</span>  
    enum RuntimeLibType {
 --- orig/tools/clang/lib/Driver/ToolChains.cpp 2016-11-23 14:25:50.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ new/tools/clang/lib/Driver/ToolChains.cpp   2017-01-04 20:52:25.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -786,6 +786,13 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     // Otherwise, let the linker search.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Driver/ToolChains.cpp      2017-09-23 20:52:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -754,6 +754,12 @@
</span>      break;
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   case ToolChain::CST_Libstdcxx:
</span> +  case ToolChain::CST_MacPortsLibstdcxx:
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+    if (getVFS().exists("@@MACPORTS_libstdc++@@")) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    if (Type==ToolChain::CST_MacPortsLibstdcxx && getVFS().exists("@@MACPORTS_libstdc++@@")) {
</span> +      CmdArgs.push_back("@@MACPORTS_libstdc++@@");
 +      return;
 +    }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+    CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3296,6 +3303,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // Unfortunately, -lstdc++ doesn't always exist in the standard search path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // it was previously found in the gcc lib dir. However, for all the Darwin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // platforms we care about it was -lstdc++.6, so we search for that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3303,6 +3309,8 @@
</span>      return ToolChain::CST_Libstdcxx;
  
    StringRef Value = A->getValue();
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+  if (Value == "macports-libstdc++" )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  if (Value == "macports-libstdc++")
</span> +      return ToolChain::CST_MacPortsLibstdcxx;
    if (Value != "libstdc++")
      getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-5.0/Portfile b/lang/llvm-5.0/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 812fc97..681f2c1 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-5.0/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-5.0/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -13,7 +13,7 @@ set clang_executable_version 5.0
</span> set lldb_executable_version 5.0.0
 name                    llvm-${llvm_version}
 revision                0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-subport                 clang-${llvm_version} { revision 2 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport                 clang-${llvm_version} { revision 3 }
</span> subport                 lldb-${llvm_version} {}
 set suffix              mp-${llvm_version}
 set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -551,12 +551,11 @@ if {${subport} eq "llvm-${llvm_version}"} {
</span>     }
 
     variant libstdcxx description {-stdlib=macports-libstdc++ searches for MacPorts libstdc++} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        depends_lib-append port:gcc6
</span> 
         patchfiles-append 9001-macports-libstdcxx.diff
 
         post-patch {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc6/c++|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc/c++|g" \
</span>                 ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
             reinplace "s|@@MACPORTS_HOST_NAME@@|${build_arch}-apple-darwin${os.major}|g" \
                 ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-5.0/files/9001-macports-libstdcxx.diff b/lang/llvm-5.0/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index 7d841eb..d4c3482 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-5.0/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-5.0/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,22 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/include/clang/Driver/ToolChain.h llvm/tools/clang/include/clang/Driver/ToolChain.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 105d0f338a..2e588bceb7 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/include/clang/Driver/ToolChain.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/include/clang/Driver/ToolChain.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -53,7 +53,8 @@ public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   enum CXXStdlibType {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     CST_Libcxx,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--    CST_Libstdcxx
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    CST_Libstdcxx,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    CST_MacPortsLibstdcxx
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   enum RuntimeLibType {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index ca3a84e75e..bcf9496d40 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -162,6 +162,9 @@ public:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/include/clang/Lex/HeaderSearchOptions.h       2015-11-17 23:54:13.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/include/clang/Lex/HeaderSearchOptions.h        2017-01-04 17:50:27.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -162,6 +162,9 @@
</span>    /// Use libc++ instead of the default libstdc++.
    unsigned UseLibcxx : 1;
  
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -26,50 +10,9 @@ index ca3a84e75e..bcf9496d40 100644
</span>    /// Whether header search information should be output as for -v.
    unsigned Verbose : 1;
  
<span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/lib/Driver/ToolChain.cpp llvm/tools/clang/lib/Driver/ToolChain.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 4f82503276..718fb7e4b2 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/lib/Driver/ToolChain.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/lib/Driver/ToolChain.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -585,6 +585,8 @@ ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     return ToolChain::CST_Libcxx;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   else if (LibName == "libstdc++")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     return ToolChain::CST_Libstdcxx;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+  else if (LibName == "macports-libstdc++")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    return ToolChain::CST_MacPortsLibstdcxx;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   else if (LibName == "platform")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     return GetDefaultCXXStdlibType();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -658,6 +660,7 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   case ToolChain::CST_Libstdcxx:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+  case ToolChain::CST_MacPortsLibstdcxx:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index e41b50c40b..4ae80f6218 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1407,6 +1407,13 @@ void DarwinClang::AddCXXStdlibLibArgs(const ArgList &Args,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     // Otherwise, let the linker search.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+  case ToolChain::CST_MacPortsLibstdcxx:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    if (getVFS().exists("@@MACPORTS_libstdc++@@")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      CmdArgs.push_back("@@MACPORTS_libstdc++@@");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 6254b0013b..3c2fb48c4b 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1486,8 +1486,10 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Frontend/CompilerInvocation.cpp   2016-07-13 15:32:15.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Frontend/CompilerInvocation.cpp    2017-01-04 17:52:18.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1522,8 +1522,10 @@
</span>    Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc);
    Opts.UseStandardSystemIncludes = !Args.hasArg(OPT_nostdsysteminc);
    Opts.UseStandardCXXIncludes = !Args.hasArg(OPT_nostdincxx);
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -81,11 +24,9 @@ index 6254b0013b..3c2fb48c4b 100644
</span>    Opts.ResourceDir = Args.getLastArgValue(OPT_resource_dir);
  
    // Canonicalize -fmodules-cache-path before storing it.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 94a7f09fd5..96dbb674de 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -108,7 +108,7 @@ static bool CanPrefixSysroot(StringRef Path) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Frontend/InitHeaderSearch.cpp     2016-05-16 10:22:25.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Frontend/InitHeaderSearch.cpp      2017-01-04 18:04:43.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -108,7 +108,7 @@
</span>  #if defined(LLVM_ON_WIN32)
    return !Path.empty() && llvm::sys::path::is_separator(Path[0]);
  #else
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -94,7 +35,7 @@ index 94a7f09fd5..96dbb674de 100644
</span>  #endif
  }
  
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -363,20 +363,31 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -363,6 +363,11 @@
</span>  
      case llvm::Triple::ppc:
      case llvm::Triple::ppc64:
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -102,27 +43,75 @@ index 94a7f09fd5..96dbb674de 100644
</span> +        AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@",
 +                                    "@@MACPORTS_HOST_NAME@@", "@@MACPORTS_GCC_SUBDIRECTORY_ppc@@", "@@MACPORTS_GCC_SUBDIRECTORY_ppc64@@",
 +                                    triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+      } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      }
</span>        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
                                    "powerpc-apple-darwin10", "", "ppc64",
                                    triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-       AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   "powerpc-apple-darwin8", "", "ppc64",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   triple);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-       break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -373,6 +378,10 @@
</span>  
      case llvm::Triple::x86:
      case llvm::Triple::x86_64:
 +      if (HSOpts.UseMacPortsLibstdcxx) {
 +        AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@",
 +                                    "@@MACPORTS_HOST_NAME@@", "@@MACPORTS_GCC_SUBDIRECTORY_i386@@", "@@MACPORTS_GCC_SUBDIRECTORY_x86_64@@", triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+      } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      }
</span>        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
                                    "i686-apple-darwin10", "", "x86_64", triple);
        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   "i686-apple-darwin8", "", "x86_64", triple);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/include/clang/Driver/ToolChain.h      2016-06-16 03:36:09.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/include/clang/Driver/ToolChain.h       2017-01-04 18:08:42.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -53,7 +53,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   enum CXXStdlibType {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     CST_Libcxx,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-    CST_Libstdcxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    CST_Libstdcxx,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    CST_MacPortsLibstdcxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   enum RuntimeLibType {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Driver/ToolChains/Darwin.cpp      2016-11-23 14:25:50.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Driver/ToolChains/Darwin.cpp       2017-09-23 20:52:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1452,6 +1452,12 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   case ToolChain::CST_Libstdcxx:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  case ToolChain::CST_MacPortsLibstdcxx:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    if (Type==ToolChain::CST_MacPortsLibstdcxx && getVFS().exists("@@MACPORTS_libstdc++@@")) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      CmdArgs.push_back("@@MACPORTS_libstdc++@@");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      return;
</span> +      }
<span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // Unfortunately, -lstdc++ doesn't always exist in the standard search path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // it was previously found in the gcc lib dir. However, for all the Darwin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // platforms we care about it was -lstdc++.6, so we search for that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Driver/ToolChains/Hexagon.cpp.orig        2017-09-24 13:38:59.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Driver/ToolChains/Hexagon.cpp      2017-09-24 14:15:41.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -466,6 +466,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     return ToolChain::CST_Libstdcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   StringRef Value = A->getValue();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  if (Value == "macports-libstdc++")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    return ToolChain::CST_MacPortsLibstdcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   if (Value != "libstdc++")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Driver/ToolChain.cpp      2016-07-15 16:13:27.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Driver/ToolChain.cpp       2017-01-05 08:14:23.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -585,6 +585,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     return ToolChain::CST_Libcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   else if (LibName == "libstdc++")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     return ToolChain::CST_Libstdcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  else if (LibName == "macports-libstdc++")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    return ToolChain::CST_MacPortsLibstdcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   else if (LibName == "platform")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     return GetDefaultCXXStdlibType();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -658,6 +660,7 @@
</span>        break;
  
<span style='display:block; white-space:pre;background:#ffe0e0;'>-     case llvm::Triple::arm:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   case ToolChain::CST_Libstdcxx:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  case ToolChain::CST_MacPortsLibstdcxx:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   }
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-devel/Portfile b/lang/llvm-devel/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 07ce3ee..fb7200a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -13,7 +13,7 @@ set clang_executable_version 6.0
</span> set lldb_executable_version 6.0.0
 name                    llvm-${llvm_version}
 revision                0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-subport                 clang-${llvm_version} { revision 2 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport                 clang-${llvm_version} { revision 3 }
</span> subport                 lldb-${llvm_version} {}
 set suffix              mp-${llvm_version}
 set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -522,6 +522,20 @@ if {${subport} eq "llvm-${llvm_version}"} {
</span>             reinplace "s|/usr/bin/env python|${prefix}/bin/python2.7|g" \
                 ${worksrcpath}/tools/clang/tools/scan-build/bin/set-xcode-analyzer \
                 ${worksrcpath}/tools/clang/tools/scan-view/bin/scan-view
<span style='display:block; white-space:pre;background:#e0ffe0;'>+        }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    variant libstdcxx description {-stdlib=macports-libstdc++ searches for MacPorts libstdc++} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        patchfiles-append 9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc/c++|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            reinplace "s|@@MACPORTS_HOST_NAME@@|${build_arch}-apple-darwin${os.major}|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            reinplace "s|@@MACPORTS_libstdc++@@|${prefix}/lib/libgcc/libstdc++.6.dylib|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                ${worksrcpath}/tools/clang/lib/Driver/ToolChains/Darwin.cpp
</span> 
             # GCC was built for ${build_arch}-apple-darwin${os.major}
             # if GCC was also built universal, it has an extra include directory
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -565,21 +579,6 @@ if {${subport} eq "llvm-${llvm_version}"} {
</span>                 ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
         }
     }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    variant libstdcxx description {-stdlib=macports-libstdc++ searches for MacPorts libstdc++} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        depends_lib-append port:gcc6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        patchfiles-append 9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        post-patch {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc6/c++|g" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            reinplace "s|@@MACPORTS_HOST_NAME@@|${build_arch}-apple-darwin${os.major}|g" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            reinplace "s|@@MACPORTS_libstdc++@@|${prefix}/lib/libgcc/libstdc++.6.dylib|g" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                ${worksrcpath}/tools/clang/lib/Driver/ToolChains/Darwin.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    }
</span>     default_variants +libstdcxx
 
     post-patch {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-devel/files/9001-macports-libstdcxx.diff b/lang/llvm-devel/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index 7d841eb..c85d383 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-devel/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-devel/files/9001-macports-libstdcxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,22 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/include/clang/Driver/ToolChain.h llvm/tools/clang/include/clang/Driver/ToolChain.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 105d0f338a..2e588bceb7 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/include/clang/Driver/ToolChain.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/include/clang/Driver/ToolChain.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -53,7 +53,8 @@ public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   enum CXXStdlibType {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     CST_Libcxx,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--    CST_Libstdcxx
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    CST_Libstdcxx,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    CST_MacPortsLibstdcxx
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   enum RuntimeLibType {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index ca3a84e75e..bcf9496d40 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -162,6 +162,9 @@ public:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/include/clang/Lex/HeaderSearchOptions.h       2015-11-17 23:54:13.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/include/clang/Lex/HeaderSearchOptions.h        2017-01-04 17:50:27.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -166,6 +166,9 @@
</span>    /// Use libc++ instead of the default libstdc++.
    unsigned UseLibcxx : 1;
  
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -26,50 +10,9 @@ index ca3a84e75e..bcf9496d40 100644
</span>    /// Whether header search information should be output as for -v.
    unsigned Verbose : 1;
  
<span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/lib/Driver/ToolChain.cpp llvm/tools/clang/lib/Driver/ToolChain.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 4f82503276..718fb7e4b2 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/lib/Driver/ToolChain.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/lib/Driver/ToolChain.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -585,6 +585,8 @@ ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     return ToolChain::CST_Libcxx;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   else if (LibName == "libstdc++")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     return ToolChain::CST_Libstdcxx;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+  else if (LibName == "macports-libstdc++")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    return ToolChain::CST_MacPortsLibstdcxx;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   else if (LibName == "platform")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     return GetDefaultCXXStdlibType();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -658,6 +660,7 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   case ToolChain::CST_Libstdcxx:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+  case ToolChain::CST_MacPortsLibstdcxx:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index e41b50c40b..4ae80f6218 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1407,6 +1407,13 @@ void DarwinClang::AddCXXStdlibLibArgs(const ArgList &Args,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     // Otherwise, let the linker search.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-     break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+  case ToolChain::CST_MacPortsLibstdcxx:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    if (getVFS().exists("@@MACPORTS_libstdc++@@")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      CmdArgs.push_back("@@MACPORTS_libstdc++@@");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 6254b0013b..3c2fb48c4b 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1486,8 +1486,10 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Frontend/CompilerInvocation.cpp   2016-07-13 15:32:15.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Frontend/CompilerInvocation.cpp    2017-01-04 17:52:18.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1539,8 +1539,10 @@
</span>    Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc);
    Opts.UseStandardSystemIncludes = !Args.hasArg(OPT_nostdsysteminc);
    Opts.UseStandardCXXIncludes = !Args.hasArg(OPT_nostdincxx);
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -81,11 +24,9 @@ index 6254b0013b..3c2fb48c4b 100644
</span>    Opts.ResourceDir = Args.getLastArgValue(OPT_resource_dir);
  
    // Canonicalize -fmodules-cache-path before storing it.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 94a7f09fd5..96dbb674de 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -108,7 +108,7 @@ static bool CanPrefixSysroot(StringRef Path) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Frontend/InitHeaderSearch.cpp     2016-05-16 10:22:25.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Frontend/InitHeaderSearch.cpp      2017-01-04 18:04:43.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -108,7 +108,7 @@
</span>  #if defined(LLVM_ON_WIN32)
    return !Path.empty() && llvm::sys::path::is_separator(Path[0]);
  #else
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -94,7 +35,7 @@ index 94a7f09fd5..96dbb674de 100644
</span>  #endif
  }
  
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -363,20 +363,31 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -362,6 +362,11 @@
</span>  
      case llvm::Triple::ppc:
      case llvm::Triple::ppc64:
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -102,27 +43,75 @@ index 94a7f09fd5..96dbb674de 100644
</span> +        AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@",
 +                                    "@@MACPORTS_HOST_NAME@@", "@@MACPORTS_GCC_SUBDIRECTORY_ppc@@", "@@MACPORTS_GCC_SUBDIRECTORY_ppc64@@",
 +                                    triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+      } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      }
</span>        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
                                    "powerpc-apple-darwin10", "", "ppc64",
                                    triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-       AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   "powerpc-apple-darwin8", "", "ppc64",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   triple);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+      }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-       break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -372,6 +377,10 @@
</span>  
      case llvm::Triple::x86:
      case llvm::Triple::x86_64:
 +      if (HSOpts.UseMacPortsLibstdcxx) {
 +        AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@",
 +                                    "@@MACPORTS_HOST_NAME@@", "@@MACPORTS_GCC_SUBDIRECTORY_i386@@", "@@MACPORTS_GCC_SUBDIRECTORY_x86_64@@", triple);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+      } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      }
</span>        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
                                    "i686-apple-darwin10", "", "x86_64", triple);
        AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                                   "i686-apple-darwin8", "", "x86_64", triple);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/include/clang/Driver/ToolChain.h      2016-06-16 03:36:09.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/include/clang/Driver/ToolChain.h       2017-01-04 18:08:42.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -75,7 +75,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   enum CXXStdlibType {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     CST_Libcxx,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-    CST_Libstdcxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    CST_Libstdcxx,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    CST_MacPortsLibstdcxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   enum RuntimeLibType {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Driver/ToolChains/Darwin.cpp      2016-11-23 14:25:50.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Driver/ToolChains/Darwin.cpp       2017-09-23 20:52:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1455,6 +1455,12 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   case ToolChain::CST_Libstdcxx:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  case ToolChain::CST_MacPortsLibstdcxx:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    if (Type==ToolChain::CST_MacPortsLibstdcxx && getVFS().exists("@@MACPORTS_libstdc++@@")) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      CmdArgs.push_back("@@MACPORTS_libstdc++@@");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      return;
</span> +      }
<span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // Unfortunately, -lstdc++ doesn't always exist in the standard search path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // it was previously found in the gcc lib dir. However, for all the Darwin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     // platforms we care about it was -lstdc++.6, so we search for that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Driver/ToolChains/Hexagon.cpp.orig        2017-09-24 13:38:59.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Driver/ToolChains/Hexagon.cpp      2017-09-24 14:15:41.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -467,6 +467,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     return ToolChain::CST_Libstdcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   StringRef Value = A->getValue();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  if (Value == "macports-libstdc++")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    return ToolChain::CST_MacPortsLibstdcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   if (Value != "libstdc++")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- orig/tools/clang/lib/Driver/ToolChain.cpp      2016-07-15 16:13:27.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ new/tools/clang/lib/Driver/ToolChain.cpp       2017-01-05 08:14:23.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -601,6 +601,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     return ToolChain::CST_Libcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   else if (LibName == "libstdc++")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     return ToolChain::CST_Libstdcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  else if (LibName == "macports-libstdc++")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    return ToolChain::CST_MacPortsLibstdcxx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   else if (LibName == "platform")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     return GetDefaultCXXStdlibType();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -682,6 +684,7 @@
</span>        break;
  
<span style='display:block; white-space:pre;background:#ffe0e0;'>-     case llvm::Triple::arm:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   case ToolChain::CST_Libstdcxx:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  case ToolChain::CST_MacPortsLibstdcxx:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     CmdArgs.push_back("-lstdc++");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   }
</span></pre><pre style='margin:0'>

</pre>