delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/18/10:15:03

X-Spam-Check-By: sourceware.org
Message-ID: <46C6FEDC.5020709@x-ray.at>
Date: Sat, 18 Aug 2007 16:14:52 +0200
From: Reini Urban <rurban AT x-ray DOT at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: empty PATH, LD_LOAD_PATH default
References: <46C6D9AF DOT 2080508 AT x-ray DOT at> <46C6DD13 DOT 7020801 AT x-ray DOT at>
In-Reply-To: <46C6DD13.7020801@x-ray.at>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

Reini Urban schrieb:

Oops! s/LD_LOAD_PATH/LD_LIBRARY_PATH/g of course.

> Reini Urban schrieb:
>> I have a minor compatibility problem.
>>
>> In Linux and other unices it is valid to start a process with an empty 
>> path because the LD_LOAD_PATH is correctly set to resolve the path for 
>> dynamic libraries.
>> I have this situation in perl TAINT-checked environments.
>> Our dll loader cannot handle LD_LOAD_PATH because in the case of 
>> linked shared libs we don't have our own loader, besides doing the 
>> dynamic dlopen.
>>
>> So in linux et al. it is valid to do:
>> $ PATH= ./someprog-with-dependent-so
>> because linux has LD_LOAD_PATH and paths from /etc/ld.so.conf
>> while under cygwin it will fail.
>>
>> Is there some fast way in the environment handling of the startup from 
>> cygwin processes before CreateProcess with a cygwin binary to detect 
>> an empty PATH, to mimic the behaviour of
>>   LD_LOAD_PATH=/usr/bin:$SYSTEMROOT/System32
>> Setting PATH to "/usr/bin/:$SYSTEMROOT:$SYSTEMROOT/System32"
>> to resolve the dll's to please the kernel loader.
> 
> $SYSTEMROOT:$SYSTEMROOT/System32 is not needed, since native windows 
> loads an exe with dll dependencies in $SYSTEMROOT/System32 and empty 
> PATH correctly. Some CreateProcess magic.
> So only some similar /usr/bin magic is required.
> 
>> Or is this a stupid idea? It would make process slower I assume if we 
>> want to detect the dependency of shared libs in processes to be created.
>>
>> I do not know how the situation of an empty PATH in cygwin
>> should be handled.
>> cygcheck does write "WARNING: PATH is not set at all!"
>> Currently the process fails to start, which seems logic, but is a bit 
>> incompatible.


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