X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Sat, 30 May 2009 11:25:52 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: R: [1.7] does LD_PRELOAD support more than 1 dll ? Message-ID: <20090530152551.GA14780@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <614736 DOT 14374 DOT qm AT web25008 DOT mail DOT ukl DOT yahoo DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <614736.14374.qm@web25008.mail.ukl.yahoo.com> User-Agent: Mutt/1.5.19 (2009-01-05) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Sat, May 30, 2009 at 12:59:15PM +0000, Marco Atzeri wrote: > >--- Sab 30/5/09, Christopher ha scritto: > >> >> ? Did you export it?? That might make a >> >> difference if the shell is involved. >> >> >> >> ? ? cheers, >> >> ? ? ? DaveK >> >> >> >Hi Dave, >> >also exporting all the 3 variables in the script >> >does make no difference >> > >> >export >> PATH="$builddir/src:$builddir/liboctave:$builddir/libcruft:$PATH" >> >export LD_PRELOAD="$liboctinterp:$liboctave:$libcruft" >> >export >> LD_LIBRARY_PATH="$builddir/src:$builddir/liboctave:$builddir/libcruft:$LD_LIBRARY_PATH" >> >OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/main-rcfile" >> \ >> >? exec $driver "$builddir/src/octave" >> --no-init-path --path="$LOADPATH" --image-path="$IMAGEPATH" >> --doc-cache-file="$DOCFILE" --info-file="$INFOFILE" "$@" >> > >> > >> >? ? ? 5 [main] sh 3964 >> C:\cygwin2\bin\sh.exe: *** fatal error - error while loading >> shared libraries: >> /pub/cygports/octave/octave-3.2.0-rc4_build/src/cygoctinterp.dll: >> cannot open shared object file: No such process >> >> From the source: >> >> ? ? ? if (!LoadLibraryW >> (lib.get_wide_win32_path (libname))) >> ? ? ? ? { >> ? ? ? ? ? __seterrno (); >> ? ? ? ? ? api_fatal ("error while >> loading shared libraries: %s: " >> ? ? ? ? ? ? ? ? >> ? ???"cannot open shared object file: >> %s", p, >> ? ? ? ? ? ? ? ? >> ? ???strerror (get_errno ())); >> ? ? ? ? } >> >> "No such process" == ESRCH == PROC_NOT_FOUND >> >> cgf > >Hi Christopher >but the dll file is there: > >$ ls -lh /pub/cygports/octave/octave-3.2.0-rc4_build/src/cygoctinterp.dll >-rwxr-xr-x 1 itq00146 Domain_Users 202M May 27 20:01 /pub/cygports/octave/octave-3.2.0-rc4_build/src/cygoctinterp.dll It doesn't say "File not found". >so how can it fail to load dlls only with LD_PRELOAD defined ? > >Ok, I found it. >The order is also relevant > >cygoctinterp.dll requires > cygcruft.dll and cygoctave.dll > >cygoctave.dll requires > cygcruft.dll > >So the working way is : > >export LD_PRELOAD="$libcruft:$liboctave:$liboctinterp" i.e., dependency order is important. That isn't too surprising is it? cgf -- 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/