Yaakov (Cygwin/X) schrieb:
On 14/01/2010 14:20, Reini Urban wrote:
I have a working cygwin llvm and llvm-gcc,
but had no time to produce a proper package yet.
Attached are my cygport files and my local config.
No patches were needed.
But I haven't bothered to build clang yet,
just the Clang llvmc plugin and llvm-gcc,
which I thought is harder to build and gives us more gcc compatibility.
Here's what I have so far for llvm/clang 2.6; the .cygport may be
missing something, it's been a few weeks since I've looked at it.
On the cygwin mailinglist we came to some required clang patches.
http://cygwin.com/ml/cygwin/2010-01/msg00587.html
Sorry, untested, as I got unrelated linker errors.
2010-01-14 Reini Urban <rur...@x-ray.at>
* tools/CIndex/CIndexer.cpp: dlladdr workaround and path conversion
* lib/Frontend/InitHeaderSearch.cpp: refactored
2009-11-24 Yaakov Selkowitz <yselkow...@users.sourceforge.net>
* tools/driver/driver.cpp, lib/Frontend/InitHeaderSearch.cpp,
lib/Headers/stddef.h: various Cygwin gcc 4.3 updates
--
Reini Urban
2010-01-14 Reini Urban <rur...@x-ray.at>
* tools/CIndex/CIndexer.cpp: dlladdr workaround and path conversion
* lib/Frontend/InitHeaderSearch.cpp: refactored
2009-11-24 Yaakov Selkowitz <yselkow...@users.sourceforge.net>
* tools/driver/driver.cpp, lib/Frontend/InitHeaderSearch.cpp,
lib/Headers/stddef.h: various Cygwin gcc 4.3 updates
Index: tools/CIndex/CIndexer.cpp
===================================================================
--- tools/CIndex/CIndexer.cpp (revision 93449)
+++ tools/CIndex/CIndexer.cpp (working copy)
@@ -31,8 +31,11 @@
#include <vector>
#include <sstream>
-#ifdef LLVM_ON_WIN32
+#if defined(LLVM_ON_WIN32) || defined(__CYGWIN__)
#include <windows.h>
+# ifdef __CYGWIN__
+# include <sys/cygwin.h>
+# endif
#else
#include <dlfcn.h>
#endif
@@ -46,14 +49,19 @@
return ClangPath;
// Find the location where this library lives (libCIndex.dylib).
-#ifdef LLVM_ON_WIN32
+#if defined(LLVM_ON_WIN32) || defined(__CYGWIN__)
MEMORY_BASIC_INFORMATION mbi;
char path[MAX_PATH];
VirtualQuery((void *)(uintptr_t)clang_createTranslationUnit, &mbi,
sizeof(mbi));
GetModuleFileNameA((HINSTANCE)mbi.AllocationBase, path, MAX_PATH);
-
+#ifdef __CYGWIN__
+ char posix_path[MAX_PATH];
+ cygwin_conv_path(CCP_WIN_A_TO_POSIX | CCP_RELATIVE, path, posix_path, MAX_PATH);
+ llvm::sys::Path CIndexPath(posix_path);
+#else
llvm::sys::Path CIndexPath(path);
+#endif
CIndexPath.eraseComponent();
CIndexPath.appendComponent("clang");
Index: tools/driver/driver.cpp
===================================================================
--- tools/driver/driver.cpp (revision 93449)
+++ tools/driver/driver.cpp (working copy)
@@ -214,7 +214,13 @@
#endif
Driver TheDriver(Path.getBasename(), Path.getDirname(),
llvm::sys::getHostTriple(),
- "a.out", IsProduction, Diags);
+#if defined(__CYGWIN__)
+ "a.exe",
+#else
+ "a.out",
+#endif
+ IsProduction,
+ Diags);
// Check for ".*++" or ".*++-[^-]*" to determine if we are a C++
// compiler. This matches things like "c++", "clang++", and "clang++-1.1".
Index: lib/Frontend/InitHeaderSearch.cpp
===================================================================
--- lib/Frontend/InitHeaderSearch.cpp (revision 93449)
+++ lib/Frontend/InitHeaderSearch.cpp (working copy)
@@ -430,6 +430,18 @@
case llvm::Triple::MinGW32:
AddPath("c:/mingw/include", System, true, false, false);
break;
+ case llvm::Triple::Cygwin:
+ // Cygwin GCC version 4
+ AddPath("/usr/lib/gcc/i686-pc-cygwin/4.3.4/include",
+ System, true, false, false);
+ // Cygwin GCC version 4
+ AddPath("/usr/local/include", System, false, false, false);
+ AddPath("/usr/include", System, false, false, false);
+ AddPath("/usr/include/w32api", System, false, false, false);
+ // Cygwin GCC version 3.4
+ AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include",
+ System, true, false, false);
+ break;
default:
break;
}
@@ -454,8 +466,14 @@
// FIXME: temporary hack: hard-coded paths.
switch (os) {
case llvm::Triple::Cygwin:
- AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include",
- System, true, false, false);
+ // Cygwin GCC version 4
+ AddPath("/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++",
+ System, true, false, false);
+ AddPath("/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/i686-pc-cygwin",
+ System, true, false, false);
+ AddPath("/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/backward",
+ System, true, false, false);
+ // Cygwin GCC version 3.4
AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include/c++",
System, true, false, false);
break;
Index: lib/Headers/stddef.h
===================================================================
--- lib/Headers/stddef.h (revision 93449)
+++ lib/Headers/stddef.h (working copy)
@@ -30,6 +30,7 @@
typedef __typeof__(sizeof(int)) size_t;
#ifndef __cplusplus
typedef __typeof__(*L"") wchar_t;
+typedef __typeof__(sizeof(*L"")) wint_t;
#endif
#ifdef __cplusplus
--
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