The mtx tests use atomic-int-isoc.h, which uses <semaphore.h>. It therefore needs this patch:
2024-06-03 Bruno Haible <br...@clisp.org> mtx tests: Fix a possible link error. * modules/mtx-tests (Files): Add m4/semaphore.m4. (configure.ac): Require gl_SEMAPHORE. (Makefile.am): Link test-mtx with @LIB_SEMAPHORE@. diff --git a/modules/mtx-tests b/modules/mtx-tests index 063a56d67f..323d392087 100644 --- a/modules/mtx-tests +++ b/modules/mtx-tests @@ -2,6 +2,7 @@ Files: tests/test-mtx.c tests/atomic-int-isoc.h tests/macros.h +m4/semaphore.m4 Depends-on: thrd @@ -12,8 +13,9 @@ random configure.ac: AC_CHECK_HEADERS_ONCE([semaphore.h]) AC_CHECK_DECLS_ONCE([alarm]) +AC_REQUIRE([gl_SEMAPHORE]) Makefile.am: TESTS += test-mtx check_PROGRAMS += test-mtx -test_mtx_LDADD = $(LDADD) @LIBSTDTHREAD@ @LIBTHREAD@ +test_mtx_LDADD = $(LDADD) @LIBSTDTHREAD@ @LIBTHREAD@ @LIB_SEMAPHORE@