On 15/04/10 00:07, Daniel Richard G. wrote: > Pádraig Brady wrote: >> >> That's very strange. >> Is the `timeout` util built for example as that uses >> much the samem functions as `kill`. >> It's like kill was being built with a different >> toolchain (like xlc_r or something). > > The vendor compiler isn't even installed on this system; only GCC. > >> Could you provide the build output from `make V=1`. > > Of course. Here is the output from compiling and linking the "timeout" and > "kill" programs: > > $ gmake V=1 timeout kill > \ > # source='/tmp/coreutils-8.4/src/timeout.c' object='timeout.o'
> gcc -std=gnu99 -I. -I/tmp/coreutils-8.4/src -I../lib > -I/tmp/coreutils-8.4/lib > -D_ALL_SOURCE -D_THREAD_SAFE -D_THREAD_SAFE -pedantic -pipe -fno-common > -W > -Wall -Wcast-align -Wformat=2 -Wpointer-arith -Wundef -Waggregate-return > -Wcast-qual > -Wmissing-declarations -Wnested-externs -Wstrict-prototypes -maix64 > -mminimal-toc > -O3 -c /tmp/coreutils-8.4/src/timeout.c > gcc -std=gnu99 -pedantic -pipe -fno-common -W -Wall -Wcast-align -Wformat=2 > > -Wpointer-arith -Wundef -Waggregate-return -Wcast-qual -Wmissing-declarations > > -Wnested-externs -Wstrict-prototypes -maix64 -mminimal-toc -O3 -o timeout > timeout.o operand2sig.o libver.a ../lib/libcoreutils.a ../lib/libcoreutils.a > gcc -std=gnu99 -I. -I/tmp/coreutils-8.4/src -I../lib > -I/tmp/coreutils-8.4/lib > -D_ALL_SOURCE -D_THREAD_SAFE -D_THREAD_SAFE -pedantic -pipe -fno-common > -W > -Wall -Wcast-align -Wformat=2 -Wpointer-arith -Wundef -Waggregate-return > -Wcast-qual > -Wmissing-declarations -Wnested-externs -Wstrict-prototypes -maix64 > -mminimal-toc > -O3 -c /tmp/coreutils-8.4/src/kill.c > gcc -std=gnu99 -pedantic -pipe -fno-common -W -Wall -Wcast-align -Wformat=2 > > -Wpointer-arith -Wundef -Waggregate-return -Wcast-qual -Wmissing-declarations > > -Wnested-externs -Wstrict-prototypes -maix64 -mminimal-toc -O3 -o kill > kill.o operand2sig.o libver.a ../lib/libcoreutils.a ../lib/libcoreutils.a > ld: 0711-317 ERROR: Undefined symbol: .pthread_once > ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific > ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific > ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. > collect2: ld returned 8 exit status So the above confirms that timeout and kill are being compiled and linked with the same options. Therefore it must be something particular to kill.c that's causing this. A quick look shows that kill.c uses strsignal() while timeout doesn't and I can now see that the gnulib replacement for this function is implemented using thread local storage. gnulib/modules/tls says to link $(LIBTHREAD), so could you try the following. It that doesn't work, could you change $(LIBTHREAD) to $(LIBMULTITHREAD). cheers, Pádraig. diff --git a/src/Makefile.am b/src/Makefile.am index 44f1237..20b306d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -394,6 +394,9 @@ who_LDADD += $(GETADDRINFO_LIB) hostname_LDADD += $(GETHOSTNAME_LIB) uname_LDADD += $(GETHOSTNAME_LIB) +# for strsignal +kill_LDADD += $(LIBTHREAD) + $(PROGRAMS): ../lib/libcoreutils.a # Get the release year from ../lib/version-etc.c.