bugGNU gettext - Bugs: bug #63371, build fails on MinGW due to...


You are not allowed to post comments on this tracker with your current authentication level.

bug #63371: build fails on MinGW due to missing gnulib close module

Submitter:  Vaclav Slavik <vslavik>
Submitted:  Tue 15 Nov 2022 06:15:05 PM UTC
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Need Info
Privacy:  Public Assigned to:  haible
Open/Closed:  Open

Wed 16 Nov 2022 05:16:57 PM UTC, comment #2: 

> The patch you provided is probably a no-op, because GNULIB_MODULES_TOOLS_FOR_SRC contains 'fopen', and 'fopen' depends on 'close'.

OK... In my defense, it is explicitly included in GNULIB_MODULES_LIBGETTEXTPO (described as "This is a subset of the GNULIB_MODULES_TOOLS_FOR_SRC" - though it was not). To be honest, I didn't even realize this could be an issue with my (unsupported) build environment; if I did, I'd try to dig deeper myself first.

I don't see any relevant variables in set's output besides perhaps those:


That is, I'm building 32bit executables. Configure command is this:

./configure -C --prefix=c:/usr/local --disable-static --disable-dependency-tracking --enable-silent-rules --with-libiconv-prefix=/d/a/gettext-tools-windows/gettext-tools-windows/build/stage/usr/local --disable-rpath --enable-nls --disable-csharp --disable-java --enable-threads=windows --enable-relocatable CFLAGS="-O2" CXXFLAGS="-O2" LDFLAGS="-Wl,--dynamicbase -Wl,--nxcompat -Wl,--no-seh"

Attaching cache and status; I wasn't able to find meaningful (to me) hints in there.

(file #53964, file #53965)

Vaclav Slavik <vslavik>
Wed 16 Nov 2022 02:37:22 AM UTC, comment #1: 

The patch you provided is probably a no-op, because GNULIB_MODULES_TOOLS_FOR_SRC contains 'fopen', and 'fopen' depends on 'close'.

Since I had tested the gettext-0.21.1 tarball on mingw-w64 before releasing it (in a Cygwin environment, as described in the INSTALL.windows file), it's likely that there are subtle differences between your environment and mine.

Can you please
1) Redo the configuration, this time with option -C, so that a config.cache is created,
2) Show the commands you use to configure and build the tarball, with all relevant environment variables (CC, CXX, CPPFLAGS, etc.),
3) Attach the generated gettext-tools/config.cache and gettext-tools/config.status files.

Bruno Haible <haible>
Project Administrator
Tue 15 Nov 2022 06:15:05 PM UTC, original submission:  

I'm seeing build failures in up-to-date MSYS2 environment when trying to build 0.21.1.

D:/a/_temp/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/bin/ld.exe: .libs/libgettextsrc_la-write-catalog.o:write-catalog.:(.text+0x6e4): undefined reference to `close_used_without_requesting_gnulib_module_close'
collect2.exe: error: ld returned 1 exit status
make[4]: *** [Makefile:3782: libgettextsrc.la] Error 1
make[4]: Leaving directory '/d/a/gettext-tools-windows/gettext-tools-windows/build/compile/gettext-0.21.1/gettext-tools/src'
make[3]: *** [Makefile:3629: all] Error 2

(Eventually, more files that use close() would be affected (msgexec.c, msggrep.c, urlget.c, write-catalog.c), this is just the first failure.)

I think this patch, which adds close to GNULIB_MODULES_TOOLS_FOR_SRC, is sufficient to fix:

diff --git a/autogen.sh b/autogen.sh
index b896c3f1e..02a5fe130 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -134,6 +134,7 @@ if ! $skip_gnulib; then
+    close

But I have difficulty successfully running "make dist" here to be able to test it, and all the relevant files are generated and not included in git.

Vaclav Slavik <vslavik>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #53964:  config.status added by vslavik (178KiB - application/octet-stream)
file #53965:  config.cache added by vslavik (43KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by vslavik (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-16 vslavik Attached File- Added config.status, #53964
        Attached File- Added config.cache, #53965
    2022-11-16 haible StatusNone Need Info
        Assigned toNone haible

    Back to the top

    Powered by Savane 3.9