This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Shall dlopen("foo") succeeed if only "foo.dll" exists?

On Nov  4 22:38, Charles Wilson wrote:
> Corinna Vinschen wrote:
> > But what about perl?  It uses the .dll suffix for modules on Cygwin.
> perl uses dl_dlopen.xs on cygwin AFAICT, which basically passes its
> arguments unchanged to the system dlopen.
> > Does it call dlopen("foo.dll") or dlopen("foo")?
> Looking at DynaLoader_pm.PL (this is self-modifying code, used to
> generate the actual, so it's a little odd):
> [...]
> On cygwin:
> use Config; print join("\n",@Config::Config{qw(dlext so dlsrc)});
> dll
> dll
> dl_dlopen.xs
> So it looks like perl itself accepts either a "bare" library name, or a
> properly .dll-decorated one (or even "-lfoo"!) -- but will eventually
> try the .dll extension if "bare" fails.

It looks like perl tries the dll suffix immediately.  I just tried

  $ perl -e 'use Alias;'

under strace and the first access is already to the file called

I removed the automatic adding of the .dll suffix, and the above
perl statement still works fine and dlopen succeeds.

I'm going to check this change in.  I think I should prepare a new
Cygwin release quite soon, not only for testing this change, but also
due to the cygpath problem.

Thanks to all of you,

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

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]