bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: guile-devel Digest, Vol 221, Issue 18


From: Bruno Haible
Subject: Re: Fwd: guile-devel Digest, Vol 221, Issue 18
Date: Sun, 20 Jun 2021 17:36:04 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; )

Hi Marc,

On 2021-04-28 you asked:
> In Guile's digest I noticed a comment about replacing libltdl (see below)
> with the standard `dlopen' interface and providing a shim for systems not
> supporting it directly.
> 
> Do Guile's observations apply in general?

libltdl provides two features:
  - portability of opening shared libraries,
  - the same functionality with static linking [1].

If guile used libltdl for portability only, then nowadays there is little
point in using it on most platforms:
  - macOS nowadays has dlopen() (and it works even though the argument
    in macOS 11 is no longer a file name, just a specific string),
  - HP-UX is dead,
  - all other Unix platforms (ELF-based ones, and Cygwin) support dlopen(),
  - native Windows has LoadLibrary instead of dlopen().

So, a simple code with #if and two branches for
  - dlopen based code,
  - LoadLibrary based code,
is totally sufficient nowadays.

> Would it make sense for the
> Gnulib project to provide such a shimmed version of `dlopen' making libltdl
> obsolete?

Hardly. It is impossible to translate a string like "libfoo.so" to
"something.dll" automatically; therefore native Windows support needs a #if
anyway.

A Gnulib module for dlopen() would therefore not bring much simplification.
And most dlopen, dlsym options (like RTLD_LAZY) cannot be supported in Windows.

Bruno

[1] https://www.gnu.org/software/libtool/manual/html_node/Dlpreopening.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]