unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#21076: dynamic-link often fails to load libraries
@ 2015-07-16 16:52 Frank Webster
  2015-07-16 23:00 ` Andreas Rottmann
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Frank Webster @ 2015-07-16 16:52 UTC (permalink / raw)
  To: 21076

On my Debian system, `dynamic-link' often fails to load shared
libraries:

Loading using a versioned soname never works:

scheme@(guile-user)> (dynamic-link "libGL.so.1")
ERROR: In procedure dynamic-link:
ERROR: In procedure dynamic-link: file: "libGL.so.1", message: "file not found"

Loading without a library extension doesn't work unless the
corresponding *-dev package is installed:

scheme@(guile-user)> (dynamic-link "libGL")
ERROR: In procedure dynamic-link:
ERROR: In procedure dynamic-link: file: "libGL", message: "file not found"

It is supposed to work with or without the extension, however because
of limitations in the underlying lt_dlopenext function in libtool,
neither works.

The first doesn't work because contrary to its
documentation, lt_dlopenext doesn't always try loading
the bare filename first, without appending an extention.

The second doesn't work because the versioned soname extension (.so.1)
isn't among the ones that lt_dlopenext tries to append. It does try the
unversioned extension (.so), but in Debian the unversioned symlink
is only available when the corresponding *-dev package is installed.

Here is a related libtool bug report: https://debbugs.gnu.org/8976

Note that there are arguably two distinct issues:
(1) lt_dlopenext not trying the bare filename in all cases
(2) lt_dlopenext not trying versioned soname extensions.

Obviously one way to address this would be to fix these two issues in
lt_dlopenext in libtool.

Alternatively, the (system foreign) module in guile could provide a
simple low-level wrapper around lt_dlopen, and possibly implement
the higher level functionality of `dynamic-link' (additional search
paths, guessing extensions etc.) in scheme.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-21 23:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-16 16:52 bug#21076: dynamic-link often fails to load libraries Frank Webster
2015-07-16 23:00 ` Andreas Rottmann
2016-06-24  8:10   ` Andy Wingo
2019-06-08 12:29 ` Isaac Jurado
2019-06-08 12:37 ` Isaac Jurado
2020-03-21 23:26   ` Ludovic Courtès
2020-03-20 23:36 ` bug#21076: dynamic-link Matt Wette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).