public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* clang++ broken by recent GCC update
@ 2013-07-04 12:47 Václav Zeman
  2013-07-04 17:34 ` Ryan Johnson
  2013-07-05 15:29 ` jojelino
  0 siblings, 2 replies; 5+ messages in thread
From: Václav Zeman @ 2013-07-04 12:47 UTC (permalink / raw)
  To: cygwin

Hi.

The C++ part of Clang package (I have not tested the C part) is broken
after update of GCC to 4.7.3. It cannot find standard C++ headers:

clang version 3.1 (branches/release_31)
Target: i386-pc-cygwin
Thread model: posix
 "/usr/bin/clang" -cc1 -triple i386-pc-cygwin -S -disable-free
-disable-llvm-verifier -main-file-name test.cxx -mrelocation-model
static -mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4
-target-linker-version 2.22.52.20120326 -momit-leaf-frame-pointer -v
-coverage-file /tmp/test-gcecaS.s -resource-dir
/usr/bin/../lib/clang/3.1 -fmodule-cache-path
/var/tmp/clang-module-cache -fdeprecated-macro
-fno-dwarf-directory-asm -fdebug-compilation-dir /cygdrive/c/stuff
-ferror-limit 19 -fmessage-length 120 -mstackrealign
-fno-use-cxa-atexit -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/test-gcecaS.s -x c++ test.cxx
clang -cc1 version 3.1 based upon LLVM 3.1 default target i386-pc-cygwin
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++"
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/i686-pc-cygwin"
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/backward"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/4.5.3/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/bin/../lib/clang/3.1/include
 /usr/include
 /usr/include/w32api
End of search list.
test.cxx:1:10: fatal error: 'cstdio' file not found
#include <cstdio>
         ^
1 error generated.

--
VZ

--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clang++ broken by recent GCC update
  2013-07-04 12:47 clang++ broken by recent GCC update Václav Zeman
@ 2013-07-04 17:34 ` Ryan Johnson
  2013-07-05 15:29 ` jojelino
  1 sibling, 0 replies; 5+ messages in thread
From: Ryan Johnson @ 2013-07-04 17:34 UTC (permalink / raw)
  To: cygwin

On 04/07/2013 8:47 AM, Václav Zeman wrote:
> Hi.
>
> The C++ part of Clang package (I have not tested the C part) is broken
> after update of GCC to 4.7.3. It cannot find standard C++ headers:
<snip>
> ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++"
> ignoring nonexistent directory
> "/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/i686-pc-cygwin"
> ignoring nonexistent directory
> "/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/backward"
> ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/4.5.3/include"
It seems like a supremely bad idea to rely on gcc's headers rather than 
shipping its own, but given that it does I assume clang needs to be 
recompiled against the new version.

Ryan


--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clang++ broken by recent GCC update
  2013-07-04 12:47 clang++ broken by recent GCC update Václav Zeman
  2013-07-04 17:34 ` Ryan Johnson
@ 2013-07-05 15:29 ` jojelino
  2013-07-05 17:36   ` jojelino
  2013-12-10 14:05   ` RJVB
  1 sibling, 2 replies; 5+ messages in thread
From: jojelino @ 2013-07-05 15:29 UTC (permalink / raw)
  To: cygwin

On 2013-07-04 PM 9:47, Václav Zeman wrote:> Hi.
 >
 > The C++ part of Clang package (I have not tested the C part) is broken
 > after update of GCC to 4.7.3. It cannot find standard C++ headers:
 >
 >
Clang does use hard-coded include path for using gcc header files.
Please build your own or you can file bug report to clang.

--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clang++ broken by recent GCC update
  2013-07-05 15:29 ` jojelino
@ 2013-07-05 17:36   ` jojelino
  2013-12-10 14:05   ` RJVB
  1 sibling, 0 replies; 5+ messages in thread
From: jojelino @ 2013-07-05 17:36 UTC (permalink / raw)
  To: cygwin

On 2013-07-04 PM 9:47, Václav Zeman wrote:> Hi.
 >
 > The C++ part of Clang package (I have not tested the C part) is broken
 > after update of GCC to 4.7.3. It cannot find standard C++ headers:
 >
 >
Clang does use hard-coded include path for using gcc header files.
Please build your own or you can file bug report to clang.


--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clang++ broken by recent GCC update
  2013-07-05 15:29 ` jojelino
  2013-07-05 17:36   ` jojelino
@ 2013-12-10 14:05   ` RJVB
  1 sibling, 0 replies; 5+ messages in thread
From: RJVB @ 2013-12-10 14:05 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-10 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04 12:47 clang++ broken by recent GCC update Václav Zeman
2013-07-04 17:34 ` Ryan Johnson
2013-07-05 15:29 ` jojelino
2013-07-05 17:36   ` jojelino
2013-12-10 14:05   ` RJVB

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).