I'm having a problem using the cygwin implemementation of dlsym. I am porting the LLVM JIT to Win32 using Cygwin. Just about everything works great (major thanks for all your work!), but dlsym works differently on unix and cygwin.
In particular, the LLVM JIT likes to look up symbols in its own process space to resolve symbols it doesn't know about. For example, if the program calls printf, it would do: void *FP = dlsym(0, "printf"); ... and the function would directly call the function. This doesn't work on cygwin, so I looked in dlfcn.cc. Changing the code in the JIT to this: void *M = dlopen(0, X); void *FP = dlsym(M, "printf"); Doesn't work either. I think the problem is that printf isn't defined in the main executable, it's probably defined in a library, which isn't being search by GetProcAddress. Does anyone know of a solution to this problem? Anything from fixing cygwin to suggesting a work-around would be very welcome. Thanks again for such a great tool! -Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/