1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

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 <ludo@gnu.org>
This commit is contained in:
Isaac Jurado 2019-06-08 14:00:29 +02:00 committed by Ludovic Courtès
parent 87bf38c93a
commit bef5e0b393
2 changed files with 10 additions and 8 deletions

View file

@ -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}.
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}. The
@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

View file

@ -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);