RFC: Cygwin 64 bit?

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Sep 1 08:46:00 GMT 2011


On Aug 15 19:25, Corinna Vinschen wrote:
> On Jul  3 11:21, Corinna Vinschen wrote:
> > On Jul  2 22:52, Charles Wilson wrote:
> > > Anyway, that's why I suggested that we add, now, a "fix" to cygwin64's
> > > dlopen to 'substitute' dlopen("cyg64*") for requests to dlopen("cyg*")
> > 
> > Good point.
> > 
> > IMHO the order should be something like this:
> > 
> >   Is suffix ".so"?
> >     Yes -> Does the file exist?
> >       Yes -> Done
> >       No  -> Replace ".so" with ".dll"
> > #ifdef __X86_64__
> >   Does the filename start with "cyg"?
> >     Yes -> Replace "cyg" with "cyg64"
> >       Does the file exist?
> >       	No -> Revert back to "cyg"
> > #endif
> >   Does the filename start with "lib"?
> >     Yes -> Replace "lib" with "cyg"/"cyg64"
> >       Does the file exist?
> >         No -> Revert back to "lib"
> >   Does the file exist?
> >     Yes -> Done
> >   return ENOENT
> 
> I implemented the above algorithm for 32 bit Cygwin now, so DLLs are
> searched for in dlopen using the above algorithm.
> 
> The patch also changes the default search path.  As before, it first
> checks for LD_LIBRARY_PATH.  However, given the fact that all shared
> libs which are usually in /usr/lib on other systems, are in /usr/bin
> on Cygwin, it makes a lot of sense to add /usr/bin to the search path.
> 
> Is that something we should do now?
> 
> 
> Corinna
> 
> 	* dlfcn.cc (gfpod_helper): Helper function to search DLL using
> 	a given DLL name.  Change default search path to allow /usr/bin.
> 	(get_full_path_of_dll): Find DLLs even if the caller used a ".so"
> 	suffix or a "lib" prefix for the DLL.

I applied the patch, but I still let LoadLibrary search the default
search path if the lib couldn't be found using the above algorithm.
This still allows to load Windows DLL using dlopen.

Please note that checking this in does *not* mean that this was the
final word on it.  We can always revert the patch if it turns out
to be impractical or if it breaks things.

I'm practically already on vacation (well, starting Saturday), but it
would be nice if this could be tested a bit while I'm off...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-developers mailing list