X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Thu, 5 Nov 2009 10:48:21 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Shall dlopen("foo") succeeed if only "foo.dll" exists?
Message-ID: <20091105094821.GJ26344@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20091102164807.GA2897@calimero.vinschen.de>  <4AEF9E10.6030804@byu.net>  <20091103100045.GA18643@calimero.vinschen.de>  <4AF0D545.7060407@cwilson.fastmail.fm>  <20091104092938.GB31924@calimero.vinschen.de>  <4AF248D2.7090208@cwilson.fastmail.fm>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4AF248D2.7090208@cwilson.fastmail.fm>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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 DynaLoader.pm, 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
this:

  $ perl -e 'use Alias;'

under strace and the first access is already to the file called
/usr/lib/perl5/vendor_perl/5.10/i686-cygwin/auto/Alias/Alias.dll

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

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

--
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

