Some more link errors of this kind, this time when the gnulib-tool option --with-c++-tests is used:
xlC -q64 -qthreaded -qtls -L/home/haible/prefix64/lib -o test-string-c++ test-string-c++.o test-string-c++2.o libtests.a ../gllib/libgnu.a libtests.a ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific ld: 0711-317 ERROR: Undefined symbol: .pthread_once ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. gmake[4]: *** [test-string-c++] Error 8 xlC -q64 -qthreaded -qtls -L/home/haible/prefix64/lib -o test-wchar-c++ test-wchar-c++.o libtests.a ../gllib/libgnu.a libtests.a ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. gmake[4]: *** [test-wchar-c++] Error 8 This patch fixes it. 2019-12-02 Bruno Haible <[email protected]> Fix link errors with --enable-threads=posix on AIX. * modules/string-c++-tests (Makefile.am): Link the test-string-c++ program with $(LIBTHREAD). * modules/wchar-c++-tests (Makefile.am): Link the test-wchar-c++ program with $(LIBTHREAD). diff --git a/modules/string-c++-tests b/modules/string-c++-tests index 2f7e23c..bd813bd 100644 --- a/modules/string-c++-tests +++ b/modules/string-c++-tests @@ -16,5 +16,5 @@ if ANSICXX TESTS += test-string-c++ check_PROGRAMS += test-string-c++ test_string_c___SOURCES = test-string-c++.cc test-string-c++2.cc -test_string_c___LDADD = $(LDADD) $(LIBINTL) +test_string_c___LDADD = $(LDADD) $(LIBINTL) $(LIBTHREAD) endif diff --git a/modules/wchar-c++-tests b/modules/wchar-c++-tests index efc9c2e..cd898e2 100644 --- a/modules/wchar-c++-tests +++ b/modules/wchar-c++-tests @@ -15,5 +15,5 @@ if ANSICXX TESTS += test-wchar-c++ check_PROGRAMS += test-wchar-c++ test_wchar_c___SOURCES = test-wchar-c++.cc -test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) +test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) $(LIBTHREAD) endif
