[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] branch master updated: Interpret dynamic library name as
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] branch master updated: Interpret dynamic library name as literal file name first. |
Date: |
Sat, 21 Mar 2020 19:29:15 -0400 |
This is an automated email from the git hooks/post-receive script.
civodul pushed a commit to branch master
in repository guile.
The following commit(s) were added to refs/heads/master by this push:
new bef5e0b Interpret dynamic library name as literal file name first.
bef5e0b is described below
commit bef5e0b3938cc88e3a1a1ac590b009875cc38162
Author: Isaac Jurado <address@hidden>
AuthorDate: Sat Jun 8 14:00:29 2019 +0200
Interpret dynamic library name as literal file name first.
Fixes <https://bugs.gnu.org/21076>.
* libguile/dynl.c (sysdep_dyn_link): Try plain lt_dlopen first, to
interpret fname as a literal path.
* doc/ref/api-foreign.texi: Update explanation to describe the new
behavior.
Co-authored-by: Ludovic Courtès <address@hidden>
---
doc/ref/api-foreign.texi | 13 ++++++++-----
libguile/dynl.c | 7 +++----
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/doc/ref/api-foreign.texi b/doc/ref/api-foreign.texi
index d99a333..b0d6c24 100644
--- a/doc/ref/api-foreign.texi
+++ b/doc/ref/api-foreign.texi
@@ -75,11 +75,14 @@ Scheme object suitable for representing the linked object
file.
Otherwise an error is thrown. How object files are searched is system
dependent.
-Normally, @var{library} is just the name of some shared library file
-that will be searched for in the places where shared libraries usually
-reside, such as in @file{/usr/lib} and @file{/usr/local/lib}.
-
-@var{library} should not contain an extension such as @code{.so}. The
+Guile first tries to load @var{library} as the absolute file name of a shared
+library. If that fails, it then falls back to interpret
+@var{library} as just the name of some shared library that will be
+searched for in the places where shared libraries usually reside, such
+as @file{/usr/lib} and @file{/usr/local/lib}.
+
+@var{library} should not contain an extension such as @code{.so}, unless
+@var{library} represents the absolute file name to the shared library. The
correct file name extension for the host operating system is provided
automatically, according to libltdl's rules (@pxref{Libltdl interface,
lt_dlopenext, @code{lt_dlopenext}, libtool, Shared Library Support for
diff --git a/libguile/dynl.c b/libguile/dynl.c
index bf7163c..e9c03e9 100644
--- a/libguile/dynl.c
+++ b/libguile/dynl.c
@@ -64,10 +64,9 @@ sysdep_dynl_link (const char *fname, const char *subr)
{
lt_dlhandle handle;
- if (fname == NULL)
- /* Return a handle for the program as a whole. */
- handle = lt_dlopen (NULL);
- else
+ /* Try the literal filename first or, if NULL, the program itself */
+ handle = lt_dlopen (fname);
+ if (handle == NULL)
{
handle = lt_dlopenext (fname);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] branch master updated: Interpret dynamic library name as literal file name first.,
Ludovic Courtès <=