X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding; q=dns; s=
	default; b=Q2Qtf0R3MALKwAivvrlhvlZqhOb3gFOsA2hLpT4tTJw42GZkAErOE
	9D4KeJQ8GWOn54x1cMT+zmGdQLwjJwSK0W61ovzdOzMtRHtLo50YWdavf2HgNj+V
	i+TrExYHc8GqustY5w2zjgS1qo57M34Ixf0L+TM6/LBBz56KELW9FI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding; s=default;
	 bh=M+8zlHcn6vhceCuucWPqOxWy0k8=; b=u6ojYqFtaeBnRzUQZtM5LhbvjHqg
	ddbgPoWq4VcxXMZuacIyjVlWN6krh/Tmvc9hJ5p9bp5LzUNCJpKq+4LTEmwneosU
	zPUDAb8GZ58T45sUHnINGJOaMhP1+A2/wwfDkT5wDeL55+ProvGDRlbx+3w8eraO
	gkccTJqj7gy17S0=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2
X-HELO: plane.gmane.org
To: cygwin@cygwin.com
From: RJVB <rjvbertin@gmail.com>
Subject: Re: clang++ broken by recent GCC update
Date: Tue, 10 Dec 2013 14:02:59 +0000 (UTC)
Lines: 95
Message-ID: <loom.20131210T144929-157@post.gmane.org>
References: <CAKw7uViT4P23=i1tV0qp8C6biy+sr59-=YAHrUkD2AnKsZU=HQ@mail.gmail.com> <51D6E666.20102@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes

jojelino <jojelino <at> gmail.com> writes:

> Clang does use hard-coded include path for using gcc header files.
> Please build your own or you can file bug report to clang.
> 

Hardcoding header file locations isn't very clever, esp. if that means 
things break even after applying a point update to gcc (4.7.3 to 4.7.x). 

Below is a modified version of llvm's 3.1-cygwin-includes.patch that 
attempts to address the issue for a certain time. Rather than relying on the 
exact version/pathname, it assumes that someone will maintain a symlink as 
is customary with shared libraries, e.g. (for current releases)

ln -s 4.8.2 /usr/lib/gcc/i686-pc-cygwin/4.8

Use setup.exe to get the llvm and clang sources and, most importantly, 
llvm.cygport. Call cygport llvm.cygport prep inside /usr/src and interrupt 
it when it starts patching. Replace the original includes.patch file with 
the modified one, call cygport llvm.cygport all (or almostall) and go do 
something else.
When this commands finishes, /usr/src/llvm-3.1-3/dist/llvm will contain all 
llvm .tar.xz installer packages, which can be installed using
tar -C / -xJf package.tar.xz .

There doesn't appear to be any need to modify the libdirs.patch file.

What also surprises me is that cygwin is so much behind with llvm/clang 
versions!

----------- cut : 3.1-cygwin-includes.patch
--- origsrc/llvm-3.1.src/tools/clang/lib/Frontend/InitHeaderSearch.cpp	
2012-03-25 17:46:17.000000000 -0500
+++ src/llvm-3.1.src/tools/clang/lib/Frontend/InitHeaderSearch.cpp	
2012-07-05 22:02:30.907716300 -0500
@@ -296,7 +296,7 @@ void InitHeaderSearch::AddDefaultCInclud
   case llvm::Triple::RTEMS:
     break;
   case llvm::Triple::Cygwin:
-    AddPath("/usr/include/w32api", System, true, false, false);
+    AddPath("/usr/lib/gcc/i686-pc-cygwin/4.5.3/include", System, true, 
false, false);
     break;
   case llvm::Triple::MinGW32: { 
       // mingw-w64 crt include paths
@@ -321,6 +321,10 @@ void InitHeaderSearch::AddDefaultCInclud
 
   if ( os != llvm::Triple::RTEMS )
     AddPath("/usr/include", System, false, false, false);
+
+  /* some w32api headers collide (e.g. iODBC/ODBC32, Mesa/OpenGL) */
+  if ( os == llvm::Triple::Cygwin )
+    AddPath("/usr/include/w32api", System, true, false, false);
 }
 
 void InitHeaderSearch::
@@ -369,9 +373,6 @@ AddDefaultCPlusPlusIncludePaths(const ll
   case llvm::Triple::Cygwin:
     // Cygwin-1.7
     AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", 
"4.5.3");
-    AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", 
"4.3.4");
-    // g++-4 / Cygwin-1.5
-    AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", 
"4.3.2");
     break;
   case llvm::Triple::MinGW32:
     // mingw-w64 C++ include paths (i686-w64-mingw32 and x86_64-w64-
mingw32)
@@ -386,6 +387,7 @@ AddDefaultCPlusPlusIncludePaths(const ll
     AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.6.3");
     AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.7.0");
     // mingw.org C++ include paths
+    AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-mingw32", 
"4.5.3");
     AddMinGWCPlusPlusIncludePaths("/mingw/lib/gcc", "mingw32", "4.5.2"); 
//MSYS
     AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.6.2");
     AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.6.1");
--- origsrc/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp	2012-05-11 
19:16:02.000000000 -0500
+++ src/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp	2012-07-04 
23:51:09.272480100 -0500
@@ -2288,7 +2290,7 @@ void Linux::AddClangCXXStdlibIncludeArgs
                                 DriverArgs, CC1Args)) {
     // Gentoo is weird and places its headers inside the GCC install, so if 
the
     // first attempt to find the headers fails, try this pattern.
-    addLibStdCXXIncludePaths(InstallDir + "/include/g++-v4",
+    addLibStdCXXIncludePaths(InstallDir + "/include/c++",
                              (GCCInstallation.getTriple().str() +
                               GCCInstallation.getMultiarchSuffix()),
                              DriverArgs, CC1Args);



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

