On Sun, Feb 22, 2026 at 07:37:05PM +0000, Gavin Smith wrote: > On Sun, Feb 22, 2026 at 06:04:51PM +0200, Eli Zaretskii wrote: > > Does this mean there are actually two copies of getopt_long and its > > subroutines? If so, why did that happen? > > I don't know if it is the direct cause of the problem but I see in > the Gnulib documentation, it says we should use an option to LT_INIT > that we are not currently using under tta/configure.ac: > > If you want it to be possible to compile your program for a native > Windows platform and you use Libtool, you need to use the ‘win32-dll’ > option of ‘LT_INIT’. In other words, put: > > LT_INIT([win32-dll]) > > in your ‘configure.ac’. > > (Info node "(gnulib)Libtool and Windows".) > > I don't know if it is worth adding this before the release though, in > case it breaks something.
It is also something that the libtool maintainer proposed we do, https://lists.gnu.org/archive/html/libtool/2025-09/msg00001.html but, if I understood well, this requires doing something like what Bruno proposes for extern variables: LIBFOO_DLL_VARIABLE char *optarg; where LIBFOO_DLL_VARIABLE needs to expand to __declspec(dllexport) or __declspec(dllimport) depending on the compilation unit. I started having a look at that for texi2any libraries, checking which extern variables were really used from other libraries, and maybe replacing variables by functions and/or adding the __declspec qualifiers. I only wanted to do that for the code in the texi2any libraries, not in Gnulib code. But then I got sidetracked by the issue I found with dlpreopen, which is also there on GNU/Linux. -- Pat
