bug-gnulib
[Top][All Lists]
Advanced

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

Re: test case build errors


From: Bruno Haible
Subject: Re: test case build errors
Date: Fri, 04 Jan 2019 20:32:44 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; )

Hi,

Tom G. Christensen wrote:
> A number of test cases currently fail to build on platforms that depend 
> on libintl for gettext functions.
> 
>  From Solaris 9/x86:
> 
> gcc -std=gnu11  -g -O2  -L/usr/tgcware/lib -R/usr/tgcware/lib -o 
> test-array_map test-array_map.o ../gllib/libgnu.a -lm   -lm     -lm
> -lm  -lm  -lm
> Undefined                       first referenced
>   symbol                             in file
> libintl_gettext                     ../gllib/libgnu.a(xalloc-die.o)
> ld: fatal: Symbol referencing errors. No output written to test-array_map
> collect2: error: ld returned 1 exit status
> make[4]: *** [test-array_map] Error 1
> 
> gcc -std=gnu11  -g -O2  -L/usr/tgcware/lib -R/usr/tgcware/lib -o 
> test-array_set test-array_set.o ../gllib/libgnu.a -lm   -lm     -lm 
> -lm  -lm  -lm
> Undefined                       first referenced
>   symbol                             in file
> libintl_gettext                     ../gllib/libgnu.a(xalloc-die.o)
> ld: fatal: Symbol referencing errors. No output written to test-array_set
> collect2: error: ld returned 1 exit status
> make[4]: *** [test-array_set] Error 1
> 
> gcc -std=gnu11  -g -O2  -L/usr/tgcware/lib -R/usr/tgcware/lib -o 
> test-bitset test-bitset.o ../gllib/libgnu.a -lm   -lm     -lm    -lm  -
> lm  -lm
> Undefined                       first referenced
>   symbol                             in file
> libintl_gettext                     ../gllib/libgnu.a(stats.o)
> ld: fatal: Symbol referencing errors. No output written to test-bitset
> collect2: error: ld returned 1 exit status
> make[4]: *** [test-bitset] Error 1
> 
> gcc -std=gnu11  -g -O2  -L/usr/tgcware/lib -R/usr/tgcware/lib -o 
> test-hash_map test-hash_map.o ../gllib/libgnu.a -lm   -lm     -lm    -l
> m  -lm  -lm
> Undefined                       first referenced
>   symbol                             in file
> libintl_gettext                     ../gllib/libgnu.a(xalloc-die.o)
> ld: fatal: Symbol referencing errors. No output written to test-hash_map
> collect2: error: ld returned 1 exit status
> make[4]: *** [test-hash_map] Error 1
> 
> gcc -std=gnu11  -g -O2  -L/usr/tgcware/lib -R/usr/tgcware/lib -o 
> test-hash_set test-hash_set.o ../gllib/libgnu.a -lm   -lm     -lm    -lm 
>   -lm  -lm
> Undefined                       first referenced
>   symbol                             in file
> libintl_gettext                     ../gllib/libgnu.a(xalloc-die.o)
> ld: fatal: Symbol referencing errors. No output written to test-hash_set
> collect2: error: ld returned 1 exit status
> make[4]: *** [test-hash_set] Error 1
> 
> gcc -std=gnu11  -g -O2  -L/usr/tgcware/lib -R/usr/tgcware/lib -o 
> test-linkedhash_map test-linkedhash_map.o ../gllib/libgnu.a -lm   -lm
>     -lm    -lm  -lm  -lm
> Undefined                       first referenced
>   symbol                             in file
> libintl_gettext                     ../gllib/libgnu.a(xalloc-die.o)
> ld: fatal: Symbol referencing errors. No output written to 
> test-linkedhash_map
> collect2: error: ld returned 1 exit status
> make[4]: *** [test-linkedhash_map] Error 1
> 
> gcc -std=gnu11  -g -O2  -L/usr/tgcware/lib -R/usr/tgcware/lib -o 
> test-linkedhash_set test-linkedhash_set.o ../gllib/libgnu.a -lm   -lm 
>   -lm    -lm  -lm  -lm
> Undefined                       first referenced
>   symbol                             in file
> libintl_gettext                     ../gllib/libgnu.a(xalloc-die.o)
> ld: fatal: Symbol referencing errors. No output written to 
> test-linkedhash_set
> collect2: error: ld returned 1 exit status
> make[4]: *** [test-linkedhash_set] Error 1

Thanks for the report. Indeed, these modules need to link against libintl:

$ ./gnulib-tool --extract-recursive-link-directive bitset
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

$ ./gnulib-tool --extract-recursive-link-directive array-map-tests
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

$ ./gnulib-tool --extract-recursive-link-directive array-set-tests
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

$ ./gnulib-tool --extract-recursive-link-directive hash-map-tests
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

$ ./gnulib-tool --extract-recursive-link-directive hash-set-tests
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

$ ./gnulib-tool --extract-recursive-link-directive linkedhash-map-tests
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

$ ./gnulib-tool --extract-recursive-link-directive linkedhash-set-tests
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

Fixed as follows.


2019-01-04  Bruno Haible  <address@hidden>

        Fix link errors in unit tests.
        Reported by Tom G. Christensen <address@hidden>.
        * modules/bitset-tests (Makefile.am): Link test-bitset against libintl.
        * modules/array-map-tests (Makefile.am): Link test-array_map against
        libintl.
        * modules/array-set-tests (Makefile.am): Link test-array_set against
        libintl.
        * modules/hash-map-tests (Makefile.am): Link test-hash_map against
        libintl.
        * modules/hash-set-tests (Makefile.am): Link test-hash_set against
        libintl.
        * modules/linkedhash-map-tests (Makefile.am): Link test-linkedhash_map
        against libintl.
        * modules/linkedhash-set-tests (Makefile.am): Link test-linkedhash_set
        against libintl.

diff --git a/modules/array-map-tests b/modules/array-map-tests
index 7dbcd73..15907eb 100644
--- a/modules/array-map-tests
+++ b/modules/array-map-tests
@@ -12,3 +12,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-array_map
 check_PROGRAMS += test-array_map
+test_array_map_LDADD = $(LDADD) @LIBINTL@
diff --git a/modules/array-set-tests b/modules/array-set-tests
index 13149f5..86b6aaa 100644
--- a/modules/array-set-tests
+++ b/modules/array-set-tests
@@ -12,3 +12,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-array_set
 check_PROGRAMS += test-array_set
+test_array_set_LDADD = $(LDADD) @LIBINTL@
diff --git a/modules/bitset-tests b/modules/bitset-tests
index 4a7b8b3..f9a0f90 100644
--- a/modules/bitset-tests
+++ b/modules/bitset-tests
@@ -9,3 +9,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-bitset
 check_PROGRAMS += test-bitset
+test_bitset_LDADD = $(LDADD) @LIBINTL@
diff --git a/modules/hash-map-tests b/modules/hash-map-tests
index 693a026..1554055 100644
--- a/modules/hash-map-tests
+++ b/modules/hash-map-tests
@@ -11,3 +11,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-hash_map
 check_PROGRAMS += test-hash_map
+test_hash_map_LDADD = $(LDADD) @LIBINTL@
diff --git a/modules/hash-set-tests b/modules/hash-set-tests
index c98898c..8da90f7 100644
--- a/modules/hash-set-tests
+++ b/modules/hash-set-tests
@@ -11,3 +11,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-hash_set
 check_PROGRAMS += test-hash_set
+test_hash_set_LDADD = $(LDADD) @LIBINTL@
diff --git a/modules/linkedhash-map-tests b/modules/linkedhash-map-tests
index a21dad3..5b13ea1 100644
--- a/modules/linkedhash-map-tests
+++ b/modules/linkedhash-map-tests
@@ -11,3 +11,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-linkedhash_map
 check_PROGRAMS += test-linkedhash_map
+test_linkedhash_map_LDADD = $(LDADD) @LIBINTL@
diff --git a/modules/linkedhash-set-tests b/modules/linkedhash-set-tests
index a22c9e0..06c1cba 100644
--- a/modules/linkedhash-set-tests
+++ b/modules/linkedhash-set-tests
@@ -11,3 +11,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-linkedhash_set
 check_PROGRAMS += test-linkedhash_set
+test_linkedhash_set_LDADD = $(LDADD) @LIBINTL@




reply via email to

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