bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: no license on some test modules


From: Eric Blake
Subject: Re: no license on some test modules
Date: Tue, 11 Dec 2007 17:48:26 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> This is because test-avltree_oset.c relies on progname.c to provide 
> program_name.  Since m4 didn't use progname.c (only the test programs did), 
> progname.o is now part of libtests.a rather than ../lib/libm4.a.  Yet, the 
use 
> of program_name doesn't occur until error.o in ../lib/libm4.a, so progname.o 
> didn't get linked into the executable when libtests.a was listed first.
> 
> Is this patch okay to apply, or do you think we will ever encounter circular 
> library dependencies that would require listing libtests.a twice in LDADD, 
both 
> before and after ../lib/libm4.a?

And indeed, there can be circular dependencies.  I tested the same m4 setup on 
mingw.  If libtests.a is listed first, progname.o is not included.  But if it 
is listed second only, then gl_array_list.o generates a missing link to xmalloc 
and friends.  The only solution is repeating the LDADD.  I'm committing the 
following:

From: Eric Blake <address@hidden>
Date: Mon, 10 Dec 2007 09:54:54 -0700
Subject: [PATCH] Avoid link failures with separate libtests.a.

* gnulib-tool (func_emit_tests_Makefile_am): Also list local_ldadd
last, to satisfy circular dependencies.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog   |    6 ++++++
 gnulib-tool |    5 ++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d7af7f9..ed8799b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 2007-12-11  Eric Blake  <address@hidden>
+
+       Avoid link failures with separate libtests.a.
+       * gnulib-tool (func_emit_tests_Makefile_am): Also list local_ldadd
+       last, to satisfy circular dependencies.
+
+2007-12-11  Eric Blake  <address@hidden>
        and Bruno Haible  <address@hidden>
 
        Fix OpenBSD 4.0 <float.h> handling of long double.
diff --git a/gnulib-tool b/gnulib-tool
index 39ac977..e70d982 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -1923,7 +1923,10 @@ func_emit_tests_Makefile_am ()
   if $use_libtests; then
     local_ldadd=' libtests.a $(LIBTESTS_LIBDEPS)'
   fi
-  echo "LDADD =${local_ldadd} ${testsbase_inverse}/${sourcebase-lib}/
${libname}.${libext}"
+  # local_ldadd must be listed first, since it often depends on non-test
+  # modules; it must also be listed last, since it can include modules
+  # such as progname that satisfy dependencies of non-test modules.
+  echo "LDADD =${local_ldadd} ${testsbase_inverse}/${sourcebase-lib}/
${libname}.${libext}${local_ldadd}"
   echo
   if $use_libtests; then
     echo "libtests_a_SOURCES ="
-- 
1.5.3.5







reply via email to

[Prev in Thread] Current Thread [Next in Thread]