Mail Archives: cygwin/2010/01/14/15:30:28
--------------070308020408080000080701
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Reini Urban schrieb:
> cygwin has only dlsym() not the SGI DL_info + dladdr() yet.
> clang just needs it to get the path for the CIndex dll.
> This should be possible with the code in the LLVM_ON_WIN32 section,
> and convert then the path from win to posix with cygwin_conv_path().
Attached is the untested patch.
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/
--------------070308020408080000080701
Content-Type: text/x-patch;
name="cygwin-path.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="cygwin-path.patch"
Index: tools/CIndex/CIndexer.cpp
===================================================================
--- tools/CIndex/CIndexer.cpp (revision 93449)
+++ tools/CIndex/CIndexer.cpp (working copy)
@@ -31,7 +31,7 @@
#include <vector>
#include <sstream>
-#ifdef LLVM_ON_WIN32
+#if defined(LLVM_ON_WIN32) || defined(__CYGWIN__)
#include <windows.h>
#else
#include <dlfcn.h>
@@ -46,14 +46,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");
--------------070308020408080000080701
Content-Type: text/plain; charset=us-ascii
--
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
--------------070308020408080000080701--
- Raw text -