From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: "Marc Nieper-Wißkirchen" <marc.nieper+gnu@gmail.com>
Subject: Re: Fwd: guile-devel Digest, Vol 221, Issue 18
Date: Sun, 20 Jun 2021 17:36:04 +0200 [thread overview]
Message-ID: <1874357.Q2JuIfmGnq@omega> (raw)
In-Reply-To: <CAEYrNrRhbpWU-_XPy8XVKVPkiVh0=oCHLu2G6xpfF4pLq65MtQ@mail.gmail.com>
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
prev parent reply other threads:[~2021-06-20 15:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.89.1619625628.4330.guile-devel@gnu.org>
2021-04-28 16:40 ` Fwd: guile-devel Digest, Vol 221, Issue 18 Marc Nieper-Wißkirchen
2021-06-20 15:36 ` Bruno Haible [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1874357.Q2JuIfmGnq@omega \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
--cc=marc.nieper+gnu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).