www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/19/05:28:09

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 19 Mar 2009 11:27:41 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [1.7] /usr/bin no longer in default LD_LIBRARY_PATH
Message-ID: <20090319102741.GA26397@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <49C210EA DOT 8080204 AT users DOT sourceforge DOT net>
MIME-Version: 1.0
In-Reply-To: <49C210EA.8080204@users.sourceforge.net>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mar 19 04:31, Yaakov S wrote:
> With 1.7, dlopen() no longer automatically searches /usr/bin by default.
>  This was definitely not the case with 1.5, but I don't see any mention
> of this in the release notes or ChangeLog.  Am I missing something here?

The default path if LD_LIBRARY_PATH isn't available is not /usr/bin, but
/usr/lib, and that has not changed since 1.5.25.  However, what happens
is this:

If a DLL can't be found in a given PATH, Cygwin 1.5.25's function
searching for the DLL (get_full_path_of_dll) just left the filename
alone.  The following LoadLibrary call then used the default DLL search
order, which includes the $PATH variable, thus a DLL in /usr/bin is
found.

Since July last year, Cygwin 1.7's get_full_path_of_dll function always
converts a filename to a full pathname, even if the file isn't found.
The resulting full pathname is $cwd/filename.  This effectlvely
suppresses the Win32 default DLL search path in LoadLibrary, thus using
either LD_LIBRARY_PATH, or /usr/lib.  From a POSIX perspective it's
wrong to rely on the default Win32 DLL load order in dlopen() and the
behaviour of dlopen() in 1.5.25 was a bug rather than a feature.

Bottom line is, I'm sure the new behaviour is more correct, but if
you have a convincing argument to revert to the old behaviour, I'm
certainly open for discussion.


Corinna

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

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019