bug-gnulib
[Top][All Lists]
Advanced

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

Re: coreutils-8.12.178-df9cd on IRIX 6.5


From: Bruno Haible
Subject: Re: coreutils-8.12.178-df9cd on IRIX 6.5
Date: Thu, 1 Sep 2011 23:12:22 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

> > On IRIX 6.5:
> > Compilation failure.
> 
>   CC       gethrxtime.o
> cc-1020 cc: ERROR File = /usr/include/internal/signal_core.h, Line = 162
>   The identifier "timespec_t" is undefined.
> 
>   extern int sigtimedwait(const sigset_t *, siginfo_t *, const timespec_t *);
>                                                                ^
> 
> 1 error detected in the compilation of "gethrxtime.c".
> *** Error code 2 (bu21)

After this error is fixed, I get a link error:

  CCLD     sort
(null): WARNING 1  : Unknown option: -as-needed (ignored).
ld32: WARNING 84 : ../lib/libcoreutils.a is not used for resolving any symbol.
ld32: ERROR   33 : Unresolved text symbol "pthread_join" -- 1st referenced by 
sort.o.
        Use linker option -v to see when and which objects, archives and dsos 
are loaded.  
ld32: INFO    152: Output file removed because of error.
*** Error code 2 (bu21)

$ make V=1
shows this command line:

cc -O -c99    -Wl,--as-needed  -o sort sort.o libver.a ../lib/libcoreutils.a  
../lib/libcoreutils.a

This is because $(LIB_PTHREAD) came out as empty:

$ grep LIB_PTHREAD config.status 
S["GNULIB_PTHREAD_SIGMASK"]="0"
S["LIB_PTHREAD"]=""

$(LIB_PTHREAD) is from m4/pthread.m4. configure yielded this output:
  checking for pthread_t... yes
  checking for pthread_spinlock_t... yes
  checking for library containing pthread_create... none required

But anyone who needs pthread_create also needs pthread_join.

$ nm /lib/libc.so.1 | grep pthread_create
[3773]  |   263054896|            |Proc    |end=3 int         |Text     | 
_pthread_create
[3774]  |          80|            |End     |ref=3773          |Text     | 
_pthread_create
[13962] |   263054896|            |Proc    |ref=3773          |Text     | 
_pthread_create
[16212] |   263054896|            |Proc    |ref=3773          |Text     | 
pthread_create
$ nm /usr/lib/libpthread.so | grep pthread_create
[449]   |   202037732|            |Proc    |end=24 int        |Text     | 
pthread_create
[450]   |         604|            |End     |ref=449           |Text     | 
pthread_create
[1035]  |   202037732|            |Proc    |ref=449           |Text     | 
pthread_create
$ nm /lib/libc.so.1 | grep pthread_join  
$ nm /usr/lib/libpthread.so | grep pthread_join  
[453]   |   202038348|            |Proc    |end=29 int        |Text     | 
pthread_join
[455]   |        1012|            |End     |ref=453           |Text     | 
pthread_join
[803]   |   202038348|            |Proc    |ref=453           |Text     | 
pthread_join

The fix is therefore to let pthread.m4 look for pthread_join, not
pthread_create. I've verified that
  - on all other platforms, except HP-UX 11.00,11.11, pthread_create and
    pthread_join are in the same libraries,
  - on HP-UX 11.00,11.11, pthread_create is redirected to
    __pthread_create_system, and __pthread_create_system and pthread_join
    are in the same libraries.

Note that the threadlib module did this right:

$ grep LIBTHREAD config.status 
S["LTLIBTHREAD"]=""
S["LIBTHREAD"]=""
$ grep LIBMULTITHREAD config.status 
S["LTLIBMULTITHREAD"]="-lpthread"
S["LIBMULTITHREAD"]="-lpthread"


2011-09-01  Bruno Haible  <address@hidden>

        pthread: Determine $(LIB_PTHREAD) correctly on IRIX 6.5.
        * m4/pthread.m4 (gl_PTHREAD_CHECK): Check for pthread_join, not
        pthread_create.

diff --git a/m4/pthread.m4 b/m4/pthread.m4
index 6111185..b60dbc8 100644
--- a/m4/pthread.m4
+++ b/m4/pthread.m4
@@ -1,4 +1,4 @@
-# pthread.m4
+# pthread.m4 serial 2
 dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -39,9 +39,9 @@ AC_DEFUN([gl_PTHREAD_CHECK],
    LIB_PTHREAD=
    if test $ac_cv_header_pthread_h = yes; then
      gl_saved_libs=$LIBS
-     AC_SEARCH_LIBS([pthread_create], [pthread],
-       [if test "$ac_cv_search_pthread_create" != "none required"; then
-          LIB_PTHREAD="$ac_cv_search_pthread_create"
+     AC_SEARCH_LIBS([pthread_join], [pthread],
+       [if test "$ac_cv_search_pthread_join" != "none required"; then
+          LIB_PTHREAD="$ac_cv_search_pthread_join"
         fi])
      LIBS="$gl_saved_libs"
    fi

-- 
In memoriam Nikolai Bryukhanov <http://en.wikipedia.org/wiki/Nikolai_Bryukhanov>



reply via email to

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