[Date Prev][Date Next] [Chronological] [Thread] [Top]

configure fails with threads again



Configure fails with threads again.

The test for pthread_create fails when it tries
     cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket

It works if it does one of these instead:
     cc -mt ...
or   cc -D_REENTRANT ... -lthread


$ uname -a
SunOS bombur 5.7 Generic sun4u sparc

$ CC=cc ./configure
creating cache ./config.cache
checking for a BSD compatible install... /local/gnu/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... missing
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... found
checking configure arguments... done
checking host system type... sparc-sun-solaris2.7
checking for a BSD compatible install... /local/gnu/bin/install -c
checking for ranlib... ranlib
checking for gcc... cc
checking whether the C compiler (cc  ) works... yes
checking whether the C compiler (cc  ) is a cross-compiler... no
checking whether we are using GNU C... no
checking whether cc accepts -g... yes
checking for non-GNU ld... /usr/ucb/ld
checking if the linker (/usr/ucb/ld) is GNU ld... no
checking for BSD-compatible nm... /usr/ccs/bin/nm -p
checking whether ln -s works... yes
checking whether we are using GNU C... no
checking for cc option to produce PIC... -KPIC
checking if cc PIC flag -KPIC works... yes
checking if cc static flag -Bstatic works... -Bstatic
checking if the linker (/usr/ucb/ld) is GNU ld... no
checking whether the linker (/usr/ucb/ld) supports shared libraries... yes
checking command to parse /usr/ccs/bin/nm -p output... yes
checking how to hardcode library paths into programs... immediate
checking for /usr/ucb/ld option to reload object files... -r
checking dynamic linker characteristics... solaris2.7 ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
checking for mawk... no
checking for gawk... gawk
checking whether ln -s works... (cached) yes
checking for sendmail... /local/sbin/sendmail
checking for vi... /local/sbin/vi
checking for finger... /usr/ucb/finger
checking how to run the C preprocessor... cc -E
checking for AIX... no
checking for POSIXized ISC... no
checking for minix/config.h... no
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for executable suffix... no
checking for object suffix... o
checking for cc option to accept ANSI C... none needed
checking for socket... no
checking for main in -lsocket... yes
checking for main in -lnet... no
checking for main in -lnsl_s... no
checking for main in -lnsl... yes
checking for socket in -linet... no
checking for main in -lgen... yes
checking for res_search... no
checking for res_search in -lbind... no
checking for res_search in -lresolv... yes
checking for sigset in -lV3... no
checking for kerberosIV/krb.h... no
checking for kerberosIV/des.h... no
checking for krb.h... no
checking for des.h... no
checking for pthread.h... yes
checking for sched.h... yes
checking POSIX thread version... final
checking for LinuxThreads... no
checking for pthread_create... yes
checking for sched_yield... no
checking for pthread_yield... no
checking for sched_yield in -lrt... yes
checking for pthread_kill... yes
checking for pthread_detach with <pthread.h>... yes
checking for pthread_setconcurrency... yes
checking for pthread_getconcurrency... yes
checking for thr_setconcurrency... yes
checking for thr_getconcurrency... yes
checking if pthread_create() works... no
configure: error: pthread.h and pthread_create are not compatible


$ cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:631: checking for a BSD compatible install
configure:684: checking whether build environment is sane
configure:741: checking whether make sets ${MAKE}
configure:780: checking for working aclocal
configure:793: checking for working autoconf
configure:806: checking for working automake
configure:819: checking for working autoheader
configure:832: checking for working makeinfo
configure:848: checking configure arguments
configure:1650: checking host system type
configure:1712: checking for a BSD compatible install
configure:1767: checking for ranlib
configure:1797: checking for gcc
configure:1910: checking whether the C compiler (cc  ) works
configure:1926: cc -o conftest    conftest.c  1>&5
configure:1952: checking whether the C compiler (cc  ) is a cross-compiler
configure:1957: checking whether we are using GNU C
configure:1966: cc -E conftest.c
configure:1985: checking whether cc accepts -g
configure:2050: checking for non-GNU ld
configure:2086: checking if the linker (/usr/ucb/ld) is GNU ld
configure:2102: checking for BSD-compatible nm
configure:2139: checking whether ln -s works
configure:2211: checking for mawk
configure:2211: checking for gawk
configure:2241: checking whether ln -s works
configure:2265: checking for sendmail
configure:2301: checking for vi
configure:2337: checking for finger
configure:2418: checking how to run the C preprocessor
configure:2439: cc -E  conftest.c >/dev/null 2>conftest.out
configure:2511: checking for AIX
configure:2535: checking for POSIXized ISC
configure:2557: checking for minix/config.h
configure:2567: cc -E  conftest.c >/dev/null 2>conftest.out
"configure", line 2563: cannot find include file: <minix/config.h>
cc: acomp failed for conftest.c
configure: failed program was:
#line 2562 "configure"
#include "confdefs.h"
#include <minix/config.h>
configure:2606: checking for Cygwin environment
configure:2622: cc -c -g  conftest.c 1>&5
"configure", line 2618: undefined symbol: __CYGWIN32__
"configure", line 2619: warning: statement not reached
cc: acomp failed for conftest.c
configure: failed program was:
#line 2611 "configure"
#include "confdefs.h"

int main() {

#ifndef __CYGWIN__
#define __CYGWIN__ __CYGWIN32__
#endif
return __CYGWIN__;
; return 0; }
configure:2639: checking for mingw32 environment
configure:2651: cc -c -g  conftest.c 1>&5
"configure", line 2647: undefined symbol: __MINGW32__
"configure", line 2648: warning: statement not reached
cc: acomp failed for conftest.c
configure: failed program was:
#line 2644 "configure"
#include "confdefs.h"

int main() {
return __MINGW32__;
; return 0; }
configure:2670: checking for executable suffix
configure:2680: cc -o conftest -g   conftest.c  1>&5
configure:2701: checking for object suffix
configure:2707: cc -c -g  conftest.c 1>&5
configure:2729: checking for cc option to accept ANSI C
configure:2782: cc  -c -g  conftest.c 1>&5
"configure", line 2779: warning: statement not reached
configure:2813: checking for socket
configure:2841: cc -o conftest -g   conftest.c  1>&5
Undefined			first referenced
 symbol  			    in file
socket                              conftest.o
ld: fatal: Symbol referencing errors. No output written to conftest
configure: failed program was:
#line 2818 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char socket(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_socket) || defined (__stub___socket)
choke me
#else
socket();
#endif

; return 0; }
configure:2860: checking for main in -lsocket
configure:2875: cc -o conftest -g   conftest.c -lsocket   1>&5
configure:2903: checking for main in -lnet
configure:2918: cc -o conftest -g   conftest.c -lnet  -lsocket  1>&5
ld: fatal: library -lnet: not found
ld: fatal: File processing errors. No output written to conftest
configure: failed program was:
#line 2911 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
configure:2946: checking for main in -lnsl_s
configure:2961: cc -o conftest -g   conftest.c -lnsl_s  -lsocket  1>&5
ld: fatal: library -lnsl_s: not found
ld: fatal: File processing errors. No output written to conftest
configure: failed program was:
#line 2954 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
configure:2989: checking for main in -lnsl
configure:3004: cc -o conftest -g   conftest.c -lnsl  -lsocket  1>&5
configure:3032: checking for socket in -linet
configure:3051: cc -o conftest -g   conftest.c -linet  -lnsl -lsocket  1>&5
ld: fatal: library -linet: not found
ld: fatal: File processing errors. No output written to conftest
configure: failed program was:
#line 3040 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {
socket()
; return 0; }
configure:3079: checking for main in -lgen
configure:3094: cc -o conftest -g   conftest.c -lgen  -lnsl -lsocket  1>&5
configure:3128: checking for res_search
configure:3156: cc -o conftest -g   conftest.c -lgen -lnsl -lsocket  1>&5
Undefined			first referenced
 symbol  			    in file
res_search                          conftest.o
ld: fatal: Symbol referencing errors. No output written to conftest
configure: failed program was:
#line 3133 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char res_search(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char res_search();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_res_search) || defined (__stub___res_search)
choke me
#else
res_search();
#endif

; return 0; }
configure:3182: checking for res_search in -lbind
configure:3201: cc -o conftest -g   conftest.c -lbind  -lgen -lnsl -lsocket  1>&5
ld: fatal: library -lbind: not found
ld: fatal: File processing errors. No output written to conftest
configure: failed program was:
#line 3190 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char res_search();

int main() {
res_search()
; return 0; }
configure:3235: checking for res_search in -lresolv
configure:3254: cc -o conftest -g   conftest.c -lresolv  -lgen -lnsl -lsocket  1>&5
configure:3291: checking for sigset in -lV3
configure:3310: cc -o conftest -g   conftest.c -lV3  -lresolv -lgen -lnsl -lsocket  1>&5
ld: fatal: library -lV3: not found
ld: fatal: File processing errors. No output written to conftest
configure: failed program was:
#line 3299 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sigset();

int main() {
sigset()
; return 0; }
configure:3564: checking for kerberosIV/krb.h
configure:3574: cc -E  conftest.c >/dev/null 2>conftest.out
"configure", line 3570: cannot find include file: <kerberosIV/krb.h>
cc: acomp failed for conftest.c
configure: failed program was:
#line 3569 "configure"
#include "confdefs.h"
#include <kerberosIV/krb.h>
configure:3564: checking for kerberosIV/des.h
configure:3574: cc -E  conftest.c >/dev/null 2>conftest.out
"configure", line 3570: cannot find include file: <kerberosIV/des.h>
cc: acomp failed for conftest.c
configure: failed program was:
#line 3569 "configure"
#include "confdefs.h"
#include <kerberosIV/des.h>
configure:3703: checking for krb.h
configure:3713: cc -E  conftest.c >/dev/null 2>conftest.out
"configure", line 3709: cannot find include file: <krb.h>
cc: acomp failed for conftest.c
configure: failed program was:
#line 3708 "configure"
#include "confdefs.h"
#include <krb.h>
configure:3703: checking for des.h
configure:3713: cc -E  conftest.c >/dev/null 2>conftest.out
"configure", line 3709: cannot find include file: <des.h>
cc: acomp failed for conftest.c
configure: failed program was:
#line 3708 "configure"
#include "confdefs.h"
#include <des.h>
configure:3803: checking for pthread.h
configure:3813: cc -E  conftest.c >/dev/null 2>conftest.out
configure:3803: checking for sched.h
configure:3813: cc -E  conftest.c >/dev/null 2>conftest.out
configure:3842: checking POSIX thread version
configure:3923: checking for LinuxThreads
configure:3949: checking for pthread_create
configure:3977: cc -o conftest -g   conftest.c -lresolv -lgen -lnsl -lsocket  1>&5
configure:4761: checking for sched_yield
configure:4789: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
Undefined			first referenced
 symbol  			    in file
sched_yield                         conftest.o
ld: fatal: Symbol referencing errors. No output written to conftest
configure: failed program was:
#line 4766 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char sched_yield(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sched_yield();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_sched_yield) || defined (__stub___sched_yield)
choke me
#else
sched_yield();
#endif

; return 0; }
configure:4761: checking for pthread_yield
configure:4789: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
Undefined			first referenced
 symbol  			    in file
pthread_yield                       conftest.o
ld: fatal: Symbol referencing errors. No output written to conftest
configure: failed program was:
#line 4766 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char pthread_yield(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char pthread_yield();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_pthread_yield) || defined (__stub___pthread_yield)
choke me
#else
pthread_yield();
#endif

; return 0; }
configure:4817: checking for sched_yield in -lrt
configure:4836: cc -o conftest -g   conftest.c -lrt   -lresolv -lgen -lnsl -lsocket  1>&5
configure:4930: checking for pthread_kill
configure:4958: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
configure:4984: checking for pthread_detach with <pthread.h>
configure:4997: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
configure:5029: checking for pthread_setconcurrency
configure:5057: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
configure:5029: checking for pthread_getconcurrency
configure:5057: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
configure:5029: checking for thr_setconcurrency
configure:5057: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
configure:5029: checking for thr_getconcurrency
configure:5057: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
configure:5083: checking if pthread_create() works
configure:5115: cc -o conftest -g   conftest.c  -lresolv -lgen -lnsl -lsocket  1>&5
configure: failed program was:
#line 5092 "configure"
#include "confdefs.h"

#include <pthread.h>
#ifndef NULL
#define NULL (void*)0
#endif

static void *task(p)
	void *p;
{
	return (void *) (p == NULL);
}

int main(argc, argv)
	int argc;
	char **argv;
{
	pthread_t t;
	exit(pthread_create(&t, NULL, task, NULL));
}