libtool dlopen [WAS: Guile and Readline won't play together]

Charles Wilson cwilson@ece.gatech.edu
Mon Jul 15 21:32:00 GMT 2002


On linux, does libguilereadline.so itself depend on libreadline.so ?  On 
cygwin, at least, cygguilereadline*.dll does NOT explicit depend on 
cygreadline*.dll -- and I think it should:

Your experiment seems to show that simply dlopen'ing the guilereadine 
library results in the rl_* functions begin available -- even tho you 
don't explicitly dlopen the readline library.  That says to me that, at 
least on linux, ldd libguildreadline.so should show an explicit 
dependency on libreadline.so. (This sort of explicit dependence does NOT 
appear in the relevent cygwin DLLs)

--Chuck

Jan Nieuwenhuizen wrote:

> "Robert Collins" <robert.collins@syncretize.net> writes:
> 
> 
>>WAG time. Perhaps libtool is looking for the .la file via libtldl. As for
>>the segfault, no idea. I'll hazard a guess that no change will occur with
>>your rebuild though.
>>
> 
> Indeed.  No change did occur.  However, rebuilding cygltdl-3.dll from
> CVS, gives me:
> 
>     $ guile
>     ERROR: In procedure dynamic-link:
>     ERROR: file: "libguilereadline", message: "file not found"
> 
> Not found eh?  So what about:
> 
>     $ guile -c '(write (dynamic-link "/usr/lib/libguilereadline.la"))'
>     #<dynamic-object "/usr/lib/libguilereadline.la">
> 
> Ah, strange that we need to provide the full path, but looks nice.
> 
> Looking at readline.scm:
> 
>     (if (not (feature? 'readline))
>     (dynamic-call "scm_init_readline" (dynamic-link "libguilereadline")))
> 
> (if (not (feature? 'readline))
>     (scm-error 'misc-error
>                #f
>                "readline is not provided in this Guile installation"
>                '()
>                '()))
> 
> and changing the dynamic-link statement to:
> 
>     (dynamic-call "scm_init_readline" (dynamic-link "/usr/lib/libguilereadline.la")))
> 
> sadly gives:
> 
>     guile
>     ERROR: readline is not provided in this Guile installation
> 
> I compiled guile and libtool with debugging info, and ran guile under
> gdb.  It seems to dlopen, but no symbols get defined:
> 
>     $ gdb -nw /usr/bin/guile.exe
>     (gdb) dir libguile
>     Source directories searched: /usr/src/guile-1.5.6-4/libguile:$cdir:$cwd
>     (gdb) b main      
>     Breakpoint 1 at 0x401072: file /home/cygwin/netrel/src/guile-1.5.6-4/libguile/guile.c, line 88.
>     (gdb) r
>     Starting program: /usr/bin/guile.exe 
> 
>     Breakpoint 1, main (argc=1, argv=0x10192810)
>         at /home/cygwin/netrel/src/guile-1.5.6-4/libguile/guile.c:88
>     88	{
>     (gdb) b scm_error
>     Breakpoint 2 at 0x1000ccb0: file /home/cygwin/netrel/src/guile-1.5.6-4/libguile/error.c, line 79.
>     (gdb) c
>     Continuing.
>     guile> (dynamic-link "/usr/lib/libguilereadline.la")
>     #<dynamic-object "/usr/lib/libguilereadline.la">
>     guile> (error)
> 
>     Breakpoint 2, scm_error (key=0x101a2ec0, subr=0x0, message=0x101e7410 "?", 
>         args=0x2174, rest=0x2174)
>         at /home/cygwin/netrel/src/guile-1.5.6-4/libguile/error.c:79
>     79	  if (scm_gc_running_p)
> 
>     (gdb) p rl_<TAB><TAB> ...
> 
> 
> Doing the very same under Linux, shows the readline rl_* functions,
> after the linking.
> 
> Any clues as to how to proceed?
> 
> Jan.
> 
> 




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list