A compilation failure occurs on mingw when some particular modules are combined:
$ ./gnulib-tool --create-testdir --dir=... --with-tests sys_select unistd binary-io Then on mingw: $ make ... test-binary-io.c: In function `main': test-binary-io.c:51: warning: implicit declaration of function `close_used_without_requesting_gnulib_module_close' mv -f .deps/test-binary-io.Tpo .deps/test-binary-io.Po gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-binary-io.exe test-binary-io.o ../gllib/libgnu.a test-binary-io.o: In function `main': /home/bruno/testdir9/gltests/test-binary-io.c:51: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-binary-io.exe] Error 1 Similarly with a couple of other tests: gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-copy-acl.exe test-copy-acl.o ../gllib/libgnu.a test-copy-acl.o: In function `main': /home/bruno/testdir9/gltests/test-copy-acl.c:83: undefined reference to `_close_used_without_requesting_gnulib_module_close' /home/bruno/testdir9/gltests/test-copy-acl.c:84: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-copy-acl.exe] Error 1 gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-binary-io.exe test-binary-io.o ../gllib/libgnu.a test-binary-io.o: In function `main': /home/bruno/testdir9/gltests/test-binary-io.c:51: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-binary-io.exe] Error 1 gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-closein.exe test-closein.o ../gllib/libgnu.a test-closein.o: In function `main': /home/bruno/testdir9/gltests/test-closein.c:47: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-closein.exe] Error 1 gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-flock.exe test-flock.o ../gllib/libgnu.a test-flock.o: In function `main': /home/bruno/testdir9/gltests/test-flock.c:57: undefined reference to `_close_used_without_requesting_gnulib_module_close' /home/bruno/testdir9/gltests/test-flock.c:75: undefined reference to `_close_used_without_requesting_gnulib_module_close' /home/bruno/testdir9/gltests/test-flock.c:103: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-flock.exe] Error 1 gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-fsync.exe test-fsync.o ../gllib/libgnu.a test-fsync.o: In function `main': /home/bruno/testdir9/gltests/test-fsync.c:48: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-fsync.exe] Error 1 gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-lseek.exe test-lseek.o ../gllib/libgnu.a test-lseek.o: In function `main': /home/bruno/testdir9/gltests/test-lseek.c:89: undefined reference to `_close_used_without_requesting_gnulib_module_close' /home/bruno/testdir9/gltests/test-lseek.c:90: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-lseek.exe] Error 1 gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-pipe.exe test-pipe.o ../gllib/libgnu.a test-pipe.o: In function `main': /home/bruno/testdir9/gltests/test-pipe.c:113: undefined reference to `_close_used_without_requesting_gnulib_module_close' /home/bruno/testdir9/gltests/test-pipe.c:198: undefined reference to `_close_used_without_requesting_gnulib_module_close' /home/bruno/testdir9/gltests/test-pipe.c:208: undefined reference to `_close_used_without_requesting_gnulib_module_close' /home/bruno/testdir9/gltests/test-pipe.c:150: undefined reference to `_close_used_without_requesting_gnulib_module_close' /home/bruno/testdir9/gltests/test-pipe.c:151: undefined reference to `_close_used_without_requesting_gnulib_module_close' test-pipe.o:/home/bruno/testdir9/gltests/test-pipe.c:197: more undefined references to `_close_used_without_requesting_gnulib_module_close' follow collect2: ld returned 1 exit status make[4]: *** [test-pipe.exe] Error 1 gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-stat-time.exe test-stat-time.o ../gllib/libgnu.a test-stat-time.o: In function `create_file': /home/bruno/testdir9/gltests/test-stat-time.c:73: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-stat-time.exe] Error 1 gcc -mno-cygwin -O2 -g -mno-cygwin -L/usr/local/mingw/lib -o test-yesno.exe test-yesno.o ../gllib/libgnu.a test-yesno.o: In function `main': /home/bruno/testdir9/gltests/test-yesno.c:60: undefined reference to `_close_used_without_requesting_gnulib_module_close' collect2: ld returned 1 exit status make[4]: *** [test-yesno.exe] Error 1 I'm applying this fix: 2009-07-19 Bruno Haible <br...@clisp.org> Fix build error on mingw with the modules sys_select and unistd. * modules/acl-tests (Depends-on): Add close. * modules/binary-io-tests (Depends-on): Likewise. * modules/closein-tests (Depends-on): Likewise. * modules/flock-tests (Depends-on): Likewise. * modules/fsync-tests (Depends-on): Likewise. * modules/lseek-tests (Depends-on): Likewise. * modules/pipe-tests (Depends-on): Likewise. * modules/posix_spawn-tests (Depends-on): Likewise. * modules/posix_spawnp-tests (Depends-on): Likewise. * modules/stat-time-tests (Depends-on): Likewise. * modules/yesno-tests (Depends-on): Likewise. *** modules/acl-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/acl-tests 2009-07-19 16:59:02.000000000 +0200 *************** *** 12,17 **** --- 12,18 ---- read-file unistd xalloc + close configure.ac: AC_CHECK_DECLS_ONCE([alarm]) *** modules/binary-io-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/binary-io-tests 2009-07-19 16:59:13.000000000 +0200 *************** *** 3,8 **** --- 3,9 ---- tests/test-binary-io.c Depends-on: + close configure.ac: *** modules/closein-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/closein-tests 2009-07-19 16:57:57.000000000 +0200 *************** *** 4,9 **** --- 4,10 ---- Depends-on: binary-io + close configure.ac: *** modules/flock-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/flock-tests 2009-07-19 16:56:41.000000000 +0200 *************** *** 3,8 **** --- 3,9 ---- Depends-on: unistd + close configure.ac: *** modules/fsync-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/fsync-tests 2009-07-19 16:57:22.000000000 +0200 *************** *** 2,7 **** --- 2,8 ---- tests/test-fsync.c Depends-on: + close configure.ac: *** modules/lseek-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/lseek-tests 2009-07-19 16:57:42.000000000 +0200 *************** *** 3,8 **** --- 3,9 ---- tests/test-lseek.sh Depends-on: + close configure.ac: *** modules/pipe-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/pipe-tests 2009-07-19 16:56:54.000000000 +0200 *************** *** 4,9 **** --- 4,10 ---- Depends-on: progname + close configure.ac: *** modules/posix_spawn-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/posix_spawn-tests 2009-07-19 16:58:19.000000000 +0200 *************** *** 8,13 **** --- 8,14 ---- stdbool unistd sys_wait + close configure.ac: AC_EGREP_CPP([notposix], [[ *** modules/posix_spawnp-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/posix_spawnp-tests 2009-07-19 16:58:23.000000000 +0200 *************** *** 18,23 **** --- 18,24 ---- stdbool unistd sys_wait + close configure.ac: AC_EGREP_CPP([notposix], [[ *** modules/stat-time-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/stat-time-tests 2009-07-19 16:59:37.000000000 +0200 *************** *** 4,9 **** --- 4,10 ---- Depends-on: time sleep + close configure.ac: *** modules/yesno-tests.orig 2009-07-19 17:04:29.000000000 +0200 --- modules/yesno-tests 2009-07-19 16:58:44.000000000 +0200 *************** *** 5,10 **** --- 5,11 ---- Depends-on: closein binary-io + close configure.ac: