From f570a82be35e36832adf0344d8d4e983c8db9e1a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Nov 2020 21:07:04 +0100 Subject: [PATCH] gnulib-tool: Fix link error with 'version-etc' (regression 2020-05-29). Reported by Simon Josefsson in . * gnulib-tool (func_emit_tests_Makefile_am): Add libtests.a to LDADD a third time, after the second occurrence of ../lib/libgnu.a. * pygnulib/GLEmiter.py (tests_Makefile_am): Likewise. --- ChangeLog | 9 +++++++++ gnulib-tool | 7 ++++--- pygnulib/GLEmiter.py | 13 +++++++------ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f30e1489b9..90169c0595 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2020-11-07 Bruno Haible + + gnulib-tool: Fix link error with 'version-etc' (regression 2020-05-29). + Reported by Simon Josefsson in + . + * gnulib-tool (func_emit_tests_Makefile_am): Add libtests.a to + LDADD a third time, after the second occurrence of ../lib/libgnu.a. + * pygnulib/GLEmiter.py (tests_Makefile_am): Likewise. + 2020-11-04 Paul Eggert tests: pacify Sun C 5.9 diff --git a/gnulib-tool b/gnulib-tool index 1ce9c30894..8b7e305dd2 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -4170,11 +4170,12 @@ func_emit_tests_Makefile_am () # It needs to be passed to the linker before ${libname}.${libext}, since # the tests-related modules depend on the main modules. # It also needs to be passed to the linker after ${libname}.${libext} - # because the latter might contain incomplete modules (such as the 'error' - # module whose dependency to 'progname' is voluntarily omitted). + # because the latter might contain incomplete modules (such as the + # 'version-etc' module whose dependency to 'version-etc-fsf' is voluntarily + # omitted). # The LIBTESTS_LIBDEPS can be passed to the linker once or twice, it does # not matter. - echo "LDADD = libtests.a ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext} libtests.a ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext} \$(LIBTESTS_LIBDEPS)" + echo "LDADD = libtests.a ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext} libtests.a ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext} libtests.a \$(LIBTESTS_LIBDEPS)" else echo "LDADD = ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext}" fi diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 441d2956d8..107f88cf21 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -1125,14 +1125,15 @@ AC_DEFUN([%V1%_LIBSOURCES], [ if libtests: # All test programs need to be linked with libtests.a. - # It needs to be passed to the linker before ${libname}.${libext}, since - # the tests-related modules depend on the main modules. + # It needs to be passed to the linker before ${libname}.${libext}, + # since the tests-related modules depend on the main modules. # It also needs to be passed to the linker after ${libname}.${libext} # because the latter might contain incomplete modules (such as the - # 'error' module whose dependency to 'progname' is voluntarily omitted). - # The LIBTESTS_LIBDEPS can be passed to the linker once or twice, it does - # not matter. - emit += 'LDADD = libtests.a %s/%s/%s.%s libtests.a %s/%s/%s.%s $(LIBTESTS_LIBDEPS)\n\n' % \ + # 'version-etc' module whose dependency to 'version-etc-fsf' is + # voluntarily omitted). + # The LIBTESTS_LIBDEPS can be passed to the linker once or twice, it + # does not matter. + emit += 'LDADD = libtests.a %s/%s/%s.%s libtests.a %s/%s/%s.%s libtests.a $(LIBTESTS_LIBDEPS)\n\n' % \ (testsbase_inverse, sourcebase, libname, libext, testsbase_inverse, sourcebase, libname, libext) else: -- 2.39.5