bug-gnulib
[Top][All Lists]
Advanced

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

Fix link errors on AIX


From: Bruno Haible
Subject: Fix link errors on AIX
Date: Tue, 17 Nov 2020 23:28:35 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-193-generic; KDE/5.18.0; x86_64; ; )

On AIX, a full gnulib testdir fails to link a couple of test programs:
  test-getumask
  test-supersede
  test-term-style-control-hello
  test-term-style-control-yes
  test-nonblocking-pipe-main
  test-nonblocking-socket-main
  test-spawn-pipe-main
  test-pipe-filter-gi1
  test-pipe-filter-gi2-main
  test-pipe-filter-ii1
  test-pipe-filter-ii2-main
all with these errors:

ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_wait
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_signal
ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_broadcast
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_destroy
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_settype
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_destroy
ld: 0711-317 ERROR: Undefined symbol: .pthread_once
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status

These are the module dependencies that get us there:

lock <-- clean-temp <-- getumask <-- getumask-tests
lock <-- clean-temp <-- javacomp
lock <-- clean-temp <-- supersede <-- supersede-tests
lock <-- fatal-signal <-- execute <-- csharpexec
lock <-- fatal-signal <-- execute <-- javaexec
lock <-- fatal-signal <-- spawn-pipe <-- spawn-pipe-tests
lock <-- fatal-signal <-- spawn-pipe <-- csharpcomp
lock <-- fatal-signal <-- spawn-pipe <-- javacomp
lock <-- fatal-signal <-- spawn-pipe <-- javaversion
lock <-- fatal-signal <-- spawn-pipe <-- pipe-filter-gi <-- pipe-filter-gi-tests
lock <-- fatal-signal <-- spawn-pipe <-- pipe-filter-ii <-- pipe-filter-ii-tests
lock <-- fatal-signal <-- term-style-control <-- test-term-style-control-tests
lock <-- fatal-signal <-- wait-process <-- nonblocking-pipe-tests
lock <-- fatal-signal <-- wait-process <-- nonblocking-socket-tests

This patch should fix it.


2020-11-17  Bruno Haible  <bruno@clisp.org>

        Fix link errors on AIX.
        * modules/clean-temp (Link): Link with $(LIBTHREAD).
        * modules/getumask (Link): Link with $(LIBTHREAD).
        * modules/getumask-tests (Makefile.am): Link test-getumask with
        $(LIBTHREAD).
        * modules/supersede (Link): Link with $(LIBTHREAD).
        * modules/supersede-tests (Makefile.am): Link test-supersede with
        $(LIBTHREAD).
        * modules/fatal-signal (Link): New section.
        * modules/execute (Link): New section.
        * modules/csharpexec (Link): Link with $(LIBTHREAD).
        * modules/javaexec (Link): Link with $(LIBTHREAD).
        * modules/spawn-pipe (Link): New section.
        * modules/spawn-pipe-tests (Makefile.am): Link test-spawn-pipe-main with
        $(LIBTHREAD).
        * modules/csharpcomp (Link): Link with $(LIBTHREAD).
        * modules/javacomp (Link): Link with $(LIBTHREAD).
        * modules/javaversion (Link): Link with $(LIBTHREAD).
        * modules/pipe-filter-gi (Link): New section.
        * modules/pipe-filter-gi-tests (Makefile.am): Link test-pipe-filter-gi1,
        test-pipe-filter-gi2-main with $(LIBTHREAD).
        * modules/pipe-filter-ii (Link): New section.
        * modules/pipe-filter-ii-tests (Makefile.am): Link test-pipe-filter-ii1,
        test-pipe-filter-ii2-main with $(LIBTHREAD).
        * modules/term-style-control (Link): New section.
        * modules/term-style-control-tests (Makefile.am): Link
        test-term-style-control-hello, test-term-style-control-yes with
        $(LIBTHREAD).
        * modules/wait-process (Link): New section.
        * modules/nonblocking-pipe-tests (Makefile.am): Link
        test-nonblocking-pipe-main with $(LIBTHREAD).
        * modules/nonblocking-socket-tests (Makefile.am): Link
        test-nonblocking-socket-main with $(LIBTHREAD).

diff --git a/modules/clean-temp b/modules/clean-temp
index 2794b93..8551ce5 100644
--- a/modules/clean-temp
+++ b/modules/clean-temp
@@ -38,6 +38,7 @@ Include:
 
 Link:
 $(LIB_GETRANDOM)
+$(LIBTHREAD)
 
 License:
 GPL
diff --git a/modules/csharpcomp b/modules/csharpcomp
index 62163f6..a880a12 100644
--- a/modules/csharpcomp
+++ b/modules/csharpcomp
@@ -29,6 +29,7 @@ Include:
 
 Link:
 $(LIB_MBRTOWC)
+$(LIBTHREAD)
 
 License:
 GPL
diff --git a/modules/csharpexec b/modules/csharpexec
index 714e0b9..853ec0b 100644
--- a/modules/csharpexec
+++ b/modules/csharpexec
@@ -29,6 +29,7 @@ Include:
 
 Link:
 $(LIB_MBRTOWC)
+$(LIBTHREAD)
 
 License:
 GPL
diff --git a/modules/execute b/modules/execute
index caf7c84..857a188 100644
--- a/modules/execute
+++ b/modules/execute
@@ -39,6 +39,9 @@ lib_SOURCES += execute.h execute.c w32spawn.h
 Include:
 "execute.h"
 
+Link:
+$(LIBTHREAD)
+
 License:
 GPL
 
diff --git a/modules/fatal-signal b/modules/fatal-signal
index 6c49f2b..c56956c 100644
--- a/modules/fatal-signal
+++ b/modules/fatal-signal
@@ -27,6 +27,9 @@ lib_SOURCES += fatal-signal.h fatal-signal.c
 Include:
 "fatal-signal.h"
 
+Link:
+$(LIBTHREAD)
+
 License:
 GPL
 
diff --git a/modules/getumask b/modules/getumask
index 61d71d0..0f21808 100644
--- a/modules/getumask
+++ b/modules/getumask
@@ -29,6 +29,7 @@ Include:
 Link:
 $(LIB_GETRANDOM)
 $(LIB_CLOCK_GETTIME)
+$(LIBTHREAD)
 
 License:
 GPL
diff --git a/modules/getumask-tests b/modules/getumask-tests
index 29b91c7..0f617da 100644
--- a/modules/getumask-tests
+++ b/modules/getumask-tests
@@ -10,4 +10,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-getumask
 check_PROGRAMS += test-getumask
-test_getumask_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) $(LIBINTL)
+test_getumask_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) 
$(LIBINTL) $(LIBTHREAD)
diff --git a/modules/javacomp b/modules/javacomp
index 5f8f60f..838aa2b 100644
--- a/modules/javacomp
+++ b/modules/javacomp
@@ -44,6 +44,7 @@ Include:
 Link:
 $(LIB_MBRTOWC)
 $(LIB_GETRANDOM)
+$(LIBTHREAD)
 
 License:
 GPL
diff --git a/modules/javaexec b/modules/javaexec
index 773093e..8322a48 100644
--- a/modules/javaexec
+++ b/modules/javaexec
@@ -30,6 +30,7 @@ Include:
 
 Link:
 $(LIB_MBRTOWC)
+$(LIBTHREAD)
 
 License:
 GPL
diff --git a/modules/javaversion b/modules/javaversion
index d1e426c..ebec3ea 100644
--- a/modules/javaversion
+++ b/modules/javaversion
@@ -27,6 +27,7 @@ Include:
 
 Link:
 $(LIB_MBRTOWC)
+$(LIBTHREAD)
 
 License:
 GPL
diff --git a/modules/nonblocking-pipe-tests b/modules/nonblocking-pipe-tests
index fa3b771..93ed45f 100644
--- a/modules/nonblocking-pipe-tests
+++ b/modules/nonblocking-pipe-tests
@@ -32,4 +32,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-nonblocking-pipe.sh
 check_PROGRAMS += test-nonblocking-pipe-main test-nonblocking-pipe-child
-test_nonblocking_pipe_main_LDADD = $(LDADD) @LIBINTL@
+test_nonblocking_pipe_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
diff --git a/modules/nonblocking-socket-tests b/modules/nonblocking-socket-tests
index 2eb883e..e2545ea 100644
--- a/modules/nonblocking-socket-tests
+++ b/modules/nonblocking-socket-tests
@@ -42,5 +42,5 @@ configure.ac:
 Makefile.am:
 TESTS += test-nonblocking-socket.sh
 check_PROGRAMS += test-nonblocking-socket-main test-nonblocking-socket-child
-test_nonblocking_socket_main_LDADD = $(LDADD) $(LIBSOCKET) @LIBINTL@
+test_nonblocking_socket_main_LDADD = $(LDADD) $(LIBSOCKET) @LIBINTL@ 
$(LIBTHREAD)
 test_nonblocking_socket_child_LDADD = $(LDADD) $(LIBSOCKET)
diff --git a/modules/pipe-filter-gi b/modules/pipe-filter-gi
index bdf47ed..84e6cb3 100644
--- a/modules/pipe-filter-gi
+++ b/modules/pipe-filter-gi
@@ -29,6 +29,9 @@ lib_SOURCES += pipe-filter-gi.c pipe-filter-aux.c
 Include:
 "pipe-filter.h"
 
+Link:
+$(LIBTHREAD)
+
 License:
 GPL
 
diff --git a/modules/pipe-filter-gi-tests b/modules/pipe-filter-gi-tests
index ef6ace3..6cca323 100644
--- a/modules/pipe-filter-gi-tests
+++ b/modules/pipe-filter-gi-tests
@@ -19,5 +19,5 @@ configure.ac:
 Makefile.am:
 TESTS += test-pipe-filter-gi1.sh test-pipe-filter-gi2.sh
 check_PROGRAMS += test-pipe-filter-gi1 test-pipe-filter-gi2-main 
test-pipe-filter-gi2-child
-test_pipe_filter_gi1_LDADD = $(LDADD) @LIBINTL@
-test_pipe_filter_gi2_main_LDADD = $(LDADD) @LIBINTL@
+test_pipe_filter_gi1_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_pipe_filter_gi2_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
diff --git a/modules/pipe-filter-ii b/modules/pipe-filter-ii
index f882219..65a0a02 100644
--- a/modules/pipe-filter-ii
+++ b/modules/pipe-filter-ii
@@ -29,6 +29,9 @@ lib_SOURCES += pipe-filter-ii.c pipe-filter-aux.c
 Include:
 "pipe-filter.h"
 
+Link:
+$(LIBTHREAD)
+
 License:
 GPL
 
diff --git a/modules/pipe-filter-ii-tests b/modules/pipe-filter-ii-tests
index 63d35ab..48d4674 100644
--- a/modules/pipe-filter-ii-tests
+++ b/modules/pipe-filter-ii-tests
@@ -18,5 +18,5 @@ configure.ac:
 Makefile.am:
 TESTS += test-pipe-filter-ii1.sh test-pipe-filter-ii2.sh
 check_PROGRAMS += test-pipe-filter-ii1 test-pipe-filter-ii2-main 
test-pipe-filter-ii2-child
-test_pipe_filter_ii1_LDADD = $(LDADD) @LIBINTL@
-test_pipe_filter_ii2_main_LDADD = $(LDADD) @LIBINTL@
+test_pipe_filter_ii1_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_pipe_filter_ii2_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
diff --git a/modules/spawn-pipe b/modules/spawn-pipe
index 4868c57..ff19236 100644
--- a/modules/spawn-pipe
+++ b/modules/spawn-pipe
@@ -45,6 +45,9 @@ lib_SOURCES += spawn-pipe.h spawn-pipe.c w32spawn.h
 Include:
 "spawn-pipe.h"
 
+Link:
+$(LIBTHREAD)
+
 License:
 GPL
 
diff --git a/modules/spawn-pipe-tests b/modules/spawn-pipe-tests
index f7831d5..9a6c0bc 100644
--- a/modules/spawn-pipe-tests
+++ b/modules/spawn-pipe-tests
@@ -12,7 +12,7 @@ configure.ac:
 Makefile.am:
 TESTS += test-spawn-pipe.sh
 check_PROGRAMS += test-spawn-pipe-main test-spawn-pipe-child
-test_spawn_pipe_main_LDADD = $(LDADD) @LIBINTL@
+test_spawn_pipe_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
 # The test-spawn-pipe-child program must be a real executable, not a libtool
 # wrapper script, and should link against as few libraries as possible.
 # Therefore don't link it against any libraries other than -lc.
diff --git a/modules/supersede b/modules/supersede
index 38f52fa..d154302 100644
--- a/modules/supersede
+++ b/modules/supersede
@@ -35,6 +35,7 @@ Include:
 Link:
 $(LIB_GETRANDOM)
 $(LIB_CLOCK_GETTIME)
+$(LIBTHREAD)
 
 License:
 GPL
diff --git a/modules/supersede-tests b/modules/supersede-tests
index 75c886b..7224d2e 100644
--- a/modules/supersede-tests
+++ b/modules/supersede-tests
@@ -19,4 +19,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-supersede
 check_PROGRAMS += test-supersede
-test_supersede_LDADD = $(LDADD) $(LIB_ACL) $(LIB_CLOCK_GETTIME) 
$(LIB_GETRANDOM) $(LIBINTL)
+test_supersede_LDADD = $(LDADD) $(LIB_ACL) $(LIB_CLOCK_GETTIME) 
$(LIB_GETRANDOM) $(LIBINTL) $(LIBTHREAD)
diff --git a/modules/term-style-control b/modules/term-style-control
index 0a2f935..a6fdd5b 100644
--- a/modules/term-style-control
+++ b/modules/term-style-control
@@ -24,6 +24,9 @@ lib_SOURCES += term-style-control.c
 Include:
 "term-style-control.h"
 
+Link:
+$(LIBTHREAD)
+
 License:
 GPL
 
diff --git a/modules/term-style-control-tests b/modules/term-style-control-tests
index 908d9fe..921c42f 100644
--- a/modules/term-style-control-tests
+++ b/modules/term-style-control-tests
@@ -13,5 +13,5 @@ Makefile.am:
 TESTS += test-term-style-control-hello
 check_PROGRAMS += test-term-style-control-hello
 noinst_PROGRAMS += test-term-style-control-yes
-test_term_style_control_hello_LDADD = $(LDADD) @LIBINTL@
-test_term_style_control_yes_LDADD = $(LDADD) @LIBINTL@
+test_term_style_control_hello_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_term_style_control_yes_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
diff --git a/modules/wait-process b/modules/wait-process
index 71b363a..7ffe832 100644
--- a/modules/wait-process
+++ b/modules/wait-process
@@ -28,6 +28,9 @@ lib_SOURCES += wait-process.h wait-process.c
 Include:
 "wait-process.h"
 
+Link:
+$(LIBTHREAD)
+
 License:
 GPL
 




reply via email to

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