bug#21076: dynamic-link

Matt Wette <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
I have encountered this issue with dynamic-link.
I propose a small patch to Guile (works on v3.0.1) to address it.
At least this allows me to load the file if I know the exact name.

This patch fixes issue with libtool and OSes which use
non-standard extensions for shared libraries.  The libltdl
function lt_dlopenext expects the argument to have a standard
extension or no extention.  Arguments reflecting shared object
files with non-standard extensions will fail to load.  For
example, my system has /usr/lib64/libyaml-0.so.2.  w/o this
patch (dynamic-link "libyaml-0.so.2") does not work; with it,
it does.  Go figure.

--- libguile/dynl.c-orig    2020-03-20 05:56:42.101214929 -0700
+++ libguile/dynl.c    2020-03-20 05:57:40.432893330 -0700
@@ -69,7 +69,10 @@
      handle = lt_dlopen (NULL);
    else
      {
-      handle = lt_dlopenext (fname);
+      handle = lt_dlopen (fname);
+
+      if (handle == NULL)
+         handle = lt_dlopenext (fname);

        if (handle == NULL
  #ifdef LT_DIRSEP_CHAR
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.