Subject: bug#54378: Subject: 29.0 Build failed

From: Eli Zaretskii <[email-masked]>
Date: Mon, 14 Mar 2022 16:11:23 +0200

> From: Po Lu <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Mon, 14 Mar 2022 21:05:22 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Then please explain what exactly is missing from the build that
> > requires dynlib to fix it, because I don't think I understand what
> > does the original problem have to do with modules or with dynamic
> > loading in general (I don't use PGTK).
> 
> It needs to load some functions dynamically using the dynlib mechanism.
> 
> These functions cannot be directly linked into the Emacs binary, since
> doing that will prevent the binary from functioning on systems that have
> GTK, but not both Xlib and libwayland-client.  They return the file
> descriptor of a display connection, so that we can initialize SIGIO for
> it and use interrupt-based input.

But why does it need dynlib?  This is only for Posix platforms, so
just use the dynamic loading functions (dlopen, dlsym etc.) directly.
There should be no need to go through dynlib.c, which is an
abstraction layer implemented specifically for modules, so that Fload
and friends could be blissfully unaware of the platform
idiosyncrasies.

When we need to dynamically load stuff in the w32-specific code, we
just call LoadLibrary and GetProcAddress directly, we don't use
dynlib.  How is this case different?