Issue 89 - threading troubles on OSF Alpha v3.2
Summary: threading troubles on OSF Alpha v3.2
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-03-03 17:57 UTC by Hallvard Furuseth
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hallvard Furuseth 1999-03-03 17:57:53 UTC
I reported this before, but I don't remember what happened:

The 2nd argument to

   pthread_create, pthread_cond_init, and pthread_mutex_init

is a struct, not a pointer to a struct, on DEC OSF Alpha v3.2, and I
think some HP versons.  So they can't be given a NULL argument to get
the default attributes, instead they should use

  pthread_attr_default, pthread_condattr_default, and
  pthread_mutexattr_default

respectively.  It worked in OPENLDAP_REL_ENG_1_0; lthread.h #defined the
symbols above as NULL if necessary.  Can we put it back, this time in
libldap_r/thr_posix.c?  If the reason it was remove was that #defining
them caused trouble, we can put something like this in thr_posix.c
instead:

  #if PTHREAD_STRUCT_ARGUMENTS /* detected by configure */
  #  define LDAP_PVT_THREAD_ATTR_DEFAULT	pthread_attr_default
  #  define LDAP_PVT_THREAD_CONDATTR_DEFAULT	pthread_condattr_default
  #  define LDAP_PVT_THREAD_MUTEXATTR_DEFAULT	pthread_condattr_default
  #else
  #  define LDAP_PVT_THREAD_ATTR_DEFAULT	NULL
  #  define LDAP_PVT_THREAD_CONDATTR_DEFAULT	NULL
  #  define LDAP_PVT_THREAD_MUTEXATTR_DEFAULT	NULL
  #endif

-- 
Hallvard
Comment 1 Kurt Zeilenga 1999-03-03 18:25:34 UTC
At 06:00 PM 3/3/99 GMT, h.b.furuseth@usit.uio.no wrote:
>I reported this before, but I don't remember what happened:

I think I must have misread my Pthread materials...

>The 2nd argument to
>   pthread_create, pthread_cond_init, and pthread_mutex_init
to get defaults should be:
>  pthread_attr_default, pthread_condattr_default, and
>  pthread_mutexattr_default

This is draft 4 behavior.  I assume HAVE_PTHREADS_D4 is defined
and HAVE_PTHREADS_FINAL is not?

>Can we put it back, this time in libldap_r/thr_posix.c?

Yes.

s/PTHREAD_STRUCT_ARGUMENTS/HAVE_PTHREAD_D4/

>  #if PTHREAD_STRUCT_ARGUMENTS /* detected by configure */
>  #  define LDAP_PVT_THREAD_ATTR_DEFAULT	pthread_attr_default
>  #  define LDAP_PVT_THREAD_CONDATTR_DEFAULT	pthread_condattr_default
>  #  define LDAP_PVT_THREAD_MUTEXATTR_DEFAULT	pthread_condattr_default
>  #else
>  #  define LDAP_PVT_THREAD_ATTR_DEFAULT	NULL
>  #  define LDAP_PVT_THREAD_CONDATTR_DEFAULT	NULL
>  #  define LDAP_PVT_THREAD_MUTEXATTR_DEFAULT	NULL
>  #endif
Comment 2 Hallvard Furuseth 1999-03-03 18:33:33 UTC
moved from Incoming to Software Bugs
Comment 3 Hallvard Furuseth 1999-03-03 19:08:14 UTC
Kurt D. Zeilenga writes:
> This is draft 4 behavior.  I assume HAVE_PTHREADS_D4 is defined
> and HAVE_PTHREADS_FINAL is not?
> 
>> Can we put it back, this time in libldap_r/thr_posix.c?
> 
> Yes.
> 
> s/PTHREAD_STRUCT_ARGUMENTS/HAVE_PTHREAD_D4/

OK, will do.   (Well, HAVE_PTHREAD!S!_D4 actually.)


But more is coming up though:

* pthread_yield() returns void, not int.  Is that D4 too?
  If so I could add this in ldap_pvt_thread_yield:

	 #ifdef HAVE_SCHED_YIELD
	        return sched_yield();
	+#elif HAVE_PTHREAD_YIELD && HAVE_PTHREADS_D4
	+       pthread_yield();
	+       return 0;
	 #elif HAVE_PTHREAD_YIELD
	        return pthread_yield();
	 #elif HAVE_THR_YIELD
	        return thr_yield();

  Or I could change ldap_pvt_thread_yield to return void; its return
  value isn't used anywhere in the ldap source anyway.


* _r functions:

  (Should I reopen the old ITS reports and repost this report there?)

  ctime_r on OSF1 v3.2 returns an int status (-1 or 0) instead of the
  buffer.  We have no configure test which detects that, or detects that
  ctime_r doesn't work as expected.
  

  gethostby{name,addr}_r take a 'struct hostent_data *' argument
  instead of the bunch of extra arguments used elsewhere.
  It must be zero-filled before its _first_ access by gethostby*_r.
  (I'm not sure what that means: per thread or per process or what.)

  I still think it's better to turn off HAVE_GETHOSTBYNAME_R & co
  instead of aborting compilation if we bump into an implementation we
  don't know how to handle.  (That doesn't mean I object to another
  configure test of course, but if this is a "private solution" I
  suspect we'll keep bumping into more private soutions.)

-- 
Hallvard
Comment 4 Hallvard Furuseth 1999-03-03 21:17:21 UTC
I wrote:
>> s/PTHREAD_STRUCT_ARGUMENTS/HAVE_PTHREAD_D4/
> 
> OK, will do.   (Well, HAVE_PTHREAD!S!_D4 actually.)

Committed those.  I forgot the configure test though.

I've put a *pseudo-patch* to configure.in (and configure) for D4
threading in <URL:ftp://ftp.openldap.org/incoming/Hallvard-990203.patch>.

The configure patch is included for reference, it is tested on OSF1
Alpha.

The configure.in *pseudo-patch* is a draft which looks like how
multi-line tests are done elsewhere in configure.in.  There may be some
syntax rules I've failed to follow, though.  *Not* tested.

-- 
Hallvard
Comment 5 Kurt Zeilenga 1999-03-03 22:31:42 UTC
changed notes
changed state Open to Test
Comment 6 Andrew Kemp 1999-03-03 23:00:23 UTC
On 03/03/99 at 19:10:56 +0000, h.b.furuseth@usit.uio.no spoke thus :
> Kurt D. Zeilenga writes:
> > This is draft 4 behavior.  I assume HAVE_PTHREADS_D4 is defined
> > and HAVE_PTHREADS_FINAL is not?
> > 
> >> Can we put it back, this time in libldap_r/thr_posix.c?
> > 
> > Yes.
> > 
> > s/PTHREAD_STRUCT_ARGUMENTS/HAVE_PTHREAD_D4/
> 
> OK, will do.   (Well, HAVE_PTHREAD!S!_D4 actually.)


Greetings, 

This discussion regarding threading on Digital Unix has prompted me to 
pass along information regarding a problem I had compiling OpenLDAP 1.2.0
under Digital Unix 4.0D

Basically, I managed to get the product to compile using Digital's native
compiler, but cannot get it compiled using gcc.

To do this though, I had to add in an additional subset, which Digital Unix
gurus (Dr. Tom Blinn) inform me will no longer be supported in the future
releases of Digital Unix/Tru64 Unix.

Below is Tom's email response to me. Could I suggest that the OpenLDAP
developers work with Tom to remove the dependency on this future obsolete
module. Thanks.


To: Andrew Kemp <andrew@lucy.cc.swin.edu.au>
Subject: Re: Thread support for Digital Unix 4.0D 
In-Reply-To: Your message of "Wed, 17 Feb 99 16:07:51 +1100."
             <19990217160751.B22288@lucy.cc.swin.edu.au> 
Date: Wed, 17 Feb 99 07:35:54 -0500
From: "Dr. Tom Blinn, 603-884-0646" <tpb@doctor.zk3.dec.com>
X-Mts: smtp
X-SpamBouncer: 1.00h (8/05/98)
X-SBClass: OK
Status: RO
Content-Length: 4121
Lines: 88


> On 16/02/99 at 18:28:55 -0500, Dr. Tom Blinn, 603-884-0646 spoke thus :
> 
> Hi again Tom,
> 
> > My suspicion is that you haven't loaded some library that needs to be on the
> > system as part of the programming support.  The "Guide" should be on the doc
> > CD, and you should be able to read it on-line from our UNIX web site (but it
> > is LOTS faster off the doc CD).  In fact, you should be able to mount up the
> > doc CD on a PC or Mac and read it that way -- it's ISO 9660 compatible, and I
> > believe it has a Netscape browser on it you can use.
> 
> I loaded the "Guide" and looked through it quite thoroughly. Unfortunately
> it doesn't document the required subsets to be installed.
> 
> Upon further investigation, I check the subsets installed on the machine
> I was trying to compile on and others we have here. The following subset
> was missing :
> 
> OSFCDAPGMR425        installed  CDA(tm) Software Development (Software Development)
> 
> So I took a punt and installed it. Now the software compiles correctly
> using the native 'cc' compiler. There is still a problem with compiling
> under 'gcc' but upon investigation on the OpenLDAP mailing list
> this is a known problem.
> 
> > If I learn anything useful that would help you along, I'll pass it along as
> > well.
> 
> Hope the above helps. I do not understand why the above module is required
> to correctly get threads working.
> 
> Regards,
> 
> Andrew Kemp
> 
> --
> Unix,WWW,Proxy,News,DNS,LDAP,... Administrator	Phone	: 61 +3 9214-8252
> IT Infrastructure Services			Fax	: 61 +3 9214-8944
> Swinburne University of Technology		E-Mail: andrew@swin.EDU.AU
> Hawthorn, Victoria, Australia 3122 	URL: http://opax.swin.edu.au/andrew

That is VERY interesting.  I don't think that you really need that subset to
get threads support, but it could be that the OpenLDAP setup script that is
driving the build believes there is a component in that subset that it needs
to do the build using "cc".  It would be interesting to examine the script and
compare the files it's looking for to the inventory list for the subset.

If you look in /usr/.smdb. you will find a file called OSFCDAPGMR425.inv ; in
that file is a list of all the files, links, and directories in the subset.
It is a somewhat odd format, tab delimited, and some of the fields might not
be obvious; the format is documented in the "Product Kits" guidebook in the
doc set.  

If you compare the list of files and links delivered in the subset to those in
the OpenLDAP build script, I bet you will get some hits.  In other words, what
I think you are finding is that the OpenLDAP build depends on one or more of
the CDA libraries in that subset.

I would have to double check the retirement list, but I believe we are getting
rid of that subset in a future release of Tru64 UNIX.  If there are libraries
in it that are needed by "freeware" products, we need to understand why that
is.  So I will probably have to go find someone to investigate this, unless
you are willing to check it out and report back your results.  (I understand
it's not something you should have to do, but if you're going to depend on the
software, we should try not to break it in a future release.)

Tom
 
 Dr. Thomas P. Blinn + UNIX Software Group + Compaq Computer Corporation
  110 Spit Brook Road, MS ZKO3-2/U20   Nashua, New Hampshire 03062-2698
   Technology Partnership Engineering           Phone:  (603) 884-0646
    Internet: tpb@zk3.dec.com           Digital's Easynet: alpha::tpb
     ACM Member: tpblinn@acm.org         PC@Home: tom@felines.mv.net

  Worry kills more people than work because more people worry than work.

      Keep your stick on the ice.        -- Steve Smith ("Red Green")

     My favorite palindrome is: Satan, oscillate my metallic sonatas.
                                         -- Phil Agre, pagre@ucsd.edu

     Yesterday it worked / Today it is not working / UNIX is like that 
			-- apologies to Margaret Segall 

  Opinions expressed herein are my own, and do not necessarily represent
  those of my employer or anyone else, living or dead, real or imagined.
 

Regards,

Andrew Kemp

-- 
Unix,WWW,Proxy,News,DNS,LDAP,... Administrator	Phone	: 61 +3 9214-8252
IT Infrastructure Services			Fax	: 61 +3 9214-8944
Swinburne University of Technology		E-Mail: andrew@swin.EDU.AU
Hawthorn, Victoria, Australia 3122 	URL: http://opax.swin.edu.au/andrew
Comment 7 Hallvard Furuseth 1999-03-06 01:59:54 UTC
With a little help, OpenLDAP now builds and configures on Alpha.
The concurrency test fails though.

"A little help" means that I need
	CC=cc LIBS=-threads ./configure

(-threads must be the last command line option to cc.)

A bare `CC=cc ./configure' does not find the -threads option, even
though there seems to be a -threads test in it.  Without -threads,
configure falls back on -lpthreads and fails, so what I said about this
"Solaris bug" applies to Alpha as well:

   From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
   Date: Sun, 21 Feb 1999 11:27:17 +0100 (MET)
   Message-Id: <HBF.990221rsn8@bombur.uio.no>
   To: "Kurt D. Zeilenga" <Kurt@OpenLDAP.org>
   Cc: openldap-bugs@OpenLDAP.org
   Subject: Re: configure fails with threads again
   
   Kurt D. Zeilenga writes:
   >  pthread_create() doesn't work as expected.
   > 
   >>configure: error: pthread.h and pthread_create are not compatible
   >  give up, environment is inconsistent.
   > 
   > I consider this is vendor bug.  Sun should provide a consistent
   > environment.
   
   Consistent?  The have provided a thread package and manual pages on how
   to use it (with -mt).  It's not their fault that configure tries to use
   it in an undocumented way.
   
   Still, the configure test would have worked if it used all the options
   which configure itself has found that other programs need.  That is,
   -D_REENTRANT ... -lpthread in this case.


On OSF1 Alpha 3.2, `-threads' could be replaced with
   -D_REENTRANT ... -lpthreads -lmach -lexc -lc_r
but not with what configures does:
   -D_REENTRANT ... -lpthreads

Of course if configure chooses gcc, it does need all the options above.


Anyway, I suggest the error message

   configure: error: pthread.h and pthread_create are not compatible

is replaced with something like

   configure: error: pthread_create failed, probably you need to specify
                     threading options to cc by hand.  See `man cc'.


typescript and config.log are enclosed, in case you want configure to
find `-threads'.



$ ./configure
creating cache ./config.cache
checking for a BSD compatible install... build/install-sh -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... missing
checking configure arguments... done
checking host system type... alpha-dec-osf3.2
checking for a BSD compatible install... build/install-sh -c
checking for ranlib... ranlib
checking for gcc... no
checking for cc... /usr/ccs/bin/cc 
checking whether the C compiler (/usr/ccs/bin/cc   ) works... yes
checking whether the C compiler (/usr/ccs/bin/cc   ) is a cross-compiler... no
checking whether we are using GNU C... no
checking whether /usr/ccs/bin/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/ucb/nm -B
checking whether ln -s works... yes
checking whether we are using GNU C... no
checking for /usr/ccs/bin/cc option to produce PIC... none
checking if /usr/ccs/bin/cc static flag -non_shared works... -non_shared
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/ucb/nm -B 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... osf3.2 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... /usr/lib/sendmail
checking for vi... /usr/ucb/vi
checking for finger... /usr/ucb/finger
checking how to run the C preprocessor... /usr/ccs/bin/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 /usr/ccs/bin/cc  option to accept ANSI C... none needed
checking for socket... yes
checking for res_search... 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 ssl.h... no
checking for pthread.h... yes
checking for sched.h... yes
checking POSIX thread version... draft4
checking for LinuxThreads... no
checking for pthread_create... no
checking for pthread_create with -kthread... no
checking for pthread_create with -pthread... no
checking for pthread_create with -pthreads... no
checking for pthread_create with -thread... no
checking for pthread_create with -mt... (cached) no
checking for pthread_mutex_unlock in -lpthread... no
checking for pthread_mutex_lock in -lpthread... no
checking for pthread_mutex_trylock in -lpthread... no
checking for pthread_create in -lpthread... no
checking for pthread_create in -lc_r... no
checking for pthread_create in -lpthreads... yes
checking for sched_yield... no
checking for pthread_yield... yes
checking for pthread_kill... no
checking for pthread_detach with <pthread.h>... yes
checking for pthread_setconcurrency... no
checking for pthread_getconcurrency... no
checking for thr_setconcurrency... no
checking for thr_getconcurrency... no
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:633: checking for a BSD compatible install
configure:686: checking whether build environment is sane
configure:743: checking whether make sets ${MAKE}
configure:782: checking for working aclocal
configure:795: checking for working autoconf
configure:808: checking for working automake
configure:821: checking for working autoheader
configure:834: checking for working makeinfo
configure:850: checking configure arguments
configure:1672: checking host system type
configure:1735: checking for a BSD compatible install
configure:1792: checking for ranlib
configure:1822: checking for gcc
configure:1852: checking for cc
configure:1935: checking whether the C compiler (/usr/ccs/bin/cc   ) works
configure:1951: /usr/ccs/bin/cc  -o conftest    conftest.c  1>&5
configure:1977: checking whether the C compiler (/usr/ccs/bin/cc   ) is a cross-compiler
configure:1982: checking whether we are using GNU C
configure:1991: /usr/ccs/bin/cc  -E conftest.c
configure:2010: checking whether /usr/ccs/bin/cc  accepts -g
configure:2075: checking for non-GNU ld
configure:2111: checking if the linker (/usr/ucb/ld) is GNU ld
configure:2127: checking for BSD-compatible nm
configure:2164: checking whether ln -s works
configure:2236: checking for mawk
configure:2236: checking for gawk
configure:2266: checking whether ln -s works
configure:2290: checking for sendmail
configure:2326: checking for vi
configure:2362: checking for finger
configure:2443: checking how to run the C preprocessor
configure:2464: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
configure:2536: checking for AIX
configure:2560: checking for POSIXized ISC
configure:2582: checking for minix/config.h
configure:2592: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
/usr/lib/cmplrs/cc/cfe: Error: configure: 2588: Cannot open file minix/config.h for #include
configure: failed program was:
#line 2587 "configure"
#include "confdefs.h"
#include <minix/config.h>
configure:2631: checking for Cygwin environment
configure:2647: /usr/ccs/bin/cc  -c -g  conftest.c 1>&5
/usr/lib/cmplrs/cc/cfe: Error: configure, line 2643: '__CYGWIN32__' undefined, reoccurrences will not be reported
 return __CYGWIN32__;
 -------^
configure: failed program was:
#line 2636 "configure"
#include "confdefs.h"

int main() {

#ifndef __CYGWIN__
#define __CYGWIN__ __CYGWIN32__
#endif
return __CYGWIN__;
; return 0; }
configure:2664: checking for mingw32 environment
configure:2676: /usr/ccs/bin/cc  -c -g  conftest.c 1>&5
/usr/lib/cmplrs/cc/cfe: Error: configure, line 2672: '__MINGW32__' undefined, reoccurrences will not be reported
 return __MINGW32__;
 -------^
configure: failed program was:
#line 2669 "configure"
#include "confdefs.h"

int main() {
return __MINGW32__;
; return 0; }
configure:2695: checking for executable suffix
configure:2705: /usr/ccs/bin/cc  -o conftest -g   conftest.c  1>&5
configure:2726: checking for object suffix
configure:2732: /usr/ccs/bin/cc  -c -g  conftest.c 1>&5
configure:2754: checking for /usr/ccs/bin/cc  option to accept ANSI C
configure:2807: /usr/ccs/bin/cc   -c -g  conftest.c 1>&5
configure:2838: checking for socket
configure:2866: /usr/ccs/bin/cc  -o conftest -g   conftest.c  1>&5
configure:3153: checking for res_search
configure:3181: /usr/ccs/bin/cc  -o conftest -g   conftest.c  1>&5
configure:3316: checking for sigset in -lV3
configure:3335: /usr/ccs/bin/cc  -o conftest -g   conftest.c -lV3   1>&5
ld:
Can't locate file for: -lV3
configure: failed program was:
#line 3324 "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:3589: checking for kerberosIV/krb.h
configure:3599: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
/usr/lib/cmplrs/cc/cfe: Error: configure: 3595: Cannot open file kerberosIV/krb.h for #include
configure: failed program was:
#line 3594 "configure"
#include "confdefs.h"
#include <kerberosIV/krb.h>
configure:3589: checking for kerberosIV/des.h
configure:3599: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
/usr/lib/cmplrs/cc/cfe: Error: configure: 3595: Cannot open file kerberosIV/des.h for #include
configure: failed program was:
#line 3594 "configure"
#include "confdefs.h"
#include <kerberosIV/des.h>
configure:3728: checking for krb.h
configure:3738: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
/usr/lib/cmplrs/cc/cfe: Error: configure: 3734: Cannot open file krb.h for #include
configure: failed program was:
#line 3733 "configure"
#include "confdefs.h"
#include <krb.h>
configure:3728: checking for des.h
configure:3738: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
/usr/lib/cmplrs/cc/cfe: Error: configure: 3734: Cannot open file des.h for #include
configure: failed program was:
#line 3733 "configure"
#include "confdefs.h"
#include <des.h>
configure:3827: checking for ssl.h
configure:3837: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
/usr/lib/cmplrs/cc/cfe: Error: configure: 3833: Cannot open file ssl.h for #include
configure: failed program was:
#line 3832 "configure"
#include "confdefs.h"
#include <ssl.h>
configure:3986: checking for pthread.h
configure:3996: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
configure:3986: checking for sched.h
configure:3996: /usr/ccs/bin/cc  -E  conftest.c >/dev/null 2>conftest.out
configure:4025: checking POSIX thread version
configure:4106: checking for LinuxThreads
configure:4132: checking for pthread_create
configure:4160: /usr/ccs/bin/cc  -o conftest -g   conftest.c  1>&5
ld:
Unresolved:
pthread_create
configure: failed program was:
#line 4137 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char pthread_create(); 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_create();

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_create) || defined (__stub___pthread_create)
choke me
#else
pthread_create();
#endif

; return 0; }
configure:4182: checking for pthread_create with -kthread
configure:4203: /usr/ccs/bin/cc  -o conftest -g   conftest.c -kthread  1>&5
ld:
Unresolved:
pthread_attr_default
pthread_create
configure: failed program was:
#line 4190 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {

#if HAVE_PTHREADS_D4
	pthread_create(NULL,pthread_attr_default,NULL,NULL);
#else
	pthread_create(NULL,NULL,NULL,NULL);
#endif

; return 0; }
configure:4227: checking for pthread_create with -pthread
configure:4248: /usr/ccs/bin/cc  -o conftest -g   conftest.c -pthread  1>&5
ld:
Unknown flag: -pthread
ld: Usage: ld [options] file [...]
configure: failed program was:
#line 4235 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {

#if HAVE_PTHREADS_D4
	pthread_create(NULL,pthread_attr_default,NULL,NULL);
#else
	pthread_create(NULL,NULL,NULL,NULL);
#endif

; return 0; }
configure:4272: checking for pthread_create with -pthreads
configure:4293: /usr/ccs/bin/cc  -o conftest -g   conftest.c -pthreads  1>&5
ld:
Unknown flag: -pthreads
ld: Usage: ld [options] file [...]
configure: failed program was:
#line 4280 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {

#if HAVE_PTHREADS_D4
	pthread_create(NULL,pthread_attr_default,NULL,NULL);
#else
	pthread_create(NULL,NULL,NULL,NULL);
#endif

; return 0; }
configure:4317: checking for pthread_create with -thread
configure:4332: /usr/ccs/bin/cc  -o conftest -g   conftest.c -thread  1>&5
ld:
Unresolved:
pthread_create
configure: failed program was:
#line 4325 "configure"
#include "confdefs.h"
char pthread_create();
int main() {
pthread_create();
; return 0; }
configure:4356: checking for pthread_create with -mt
configure:4396: checking for pthread_mutex_unlock in -lpthread
configure:4415: /usr/ccs/bin/cc  -o conftest -g   conftest.c -lpthread -lmach -lexc -lc_r  1>&5
ld:
Can't locate file for: -lpthread
configure: failed program was:
#line 4404 "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 pthread_mutex_unlock();

int main() {
pthread_mutex_unlock()
; return 0; }
configure:4448: checking for pthread_mutex_lock in -lpthread
configure:4467: /usr/ccs/bin/cc  -o conftest -g   conftest.c -lpthread -lmach -lexc  1>&5
ld:
Can't locate file for: -lpthread
configure: failed program was:
#line 4456 "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 pthread_mutex_lock();

int main() {
pthread_mutex_lock()
; return 0; }
configure:4500: checking for pthread_mutex_trylock in -lpthread
configure:4519: /usr/ccs/bin/cc  -o conftest -g   conftest.c -lpthread -lexc  1>&5
ld:
Can't locate file for: -lpthread
configure: failed program was:
#line 4508 "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 pthread_mutex_trylock();

int main() {
pthread_mutex_trylock()
; return 0; }
configure:4552: checking for pthread_create in -lpthread
configure:4571: /usr/ccs/bin/cc  -o conftest -g   conftest.c -lpthread   1>&5
ld:
Can't locate file for: -lpthread
configure: failed program was:
#line 4560 "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 pthread_create();

int main() {
pthread_create()
; return 0; }
configure:4600: checking for pthread_create in -lc_r
configure:4619: /usr/ccs/bin/cc  -o conftest -g   conftest.c -lc_r   1>&5
ld:
Unresolved:
pthread_create
configure: failed program was:
#line 4608 "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 pthread_create();

int main() {
pthread_create()
; return 0; }
configure:4648: checking for pthread_create in -lpthreads
configure:4667: /usr/ccs/bin/cc  -o conftest -g   conftest.c -lpthreads   1>&5
configure:4952: checking for sched_yield
configure:4980: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
ld:
Unresolved:
sched_yield
configure: failed program was:
#line 4957 "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:4952: checking for pthread_yield
configure:4980: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
configure:5121: checking for pthread_kill
configure:5149: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
ld:
Unresolved:
pthread_kill
configure: failed program was:
#line 5126 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char pthread_kill(); 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_kill();

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_kill) || defined (__stub___pthread_kill)
choke me
#else
pthread_kill();
#endif

; return 0; }
configure:5175: checking for pthread_detach with <pthread.h>
configure:5188: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
configure:5220: checking for pthread_setconcurrency
configure:5248: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
ld:
Unresolved:
pthread_setconcurrency
configure: failed program was:
#line 5225 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char pthread_setconcurrency(); 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_setconcurrency();

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_setconcurrency) || defined (__stub___pthread_setconcurrency)
choke me
#else
pthread_setconcurrency();
#endif

; return 0; }
configure:5220: checking for pthread_getconcurrency
configure:5248: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
ld:
Unresolved:
pthread_getconcurrency
configure: failed program was:
#line 5225 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char pthread_getconcurrency(); 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_getconcurrency();

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_getconcurrency) || defined (__stub___pthread_getconcurrency)
choke me
#else
pthread_getconcurrency();
#endif

; return 0; }
configure:5220: checking for thr_setconcurrency
configure:5248: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
ld:
Unresolved:
thr_setconcurrency
configure: failed program was:
#line 5225 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char thr_setconcurrency(); 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 thr_setconcurrency();

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_thr_setconcurrency) || defined (__stub___thr_setconcurrency)
choke me
#else
thr_setconcurrency();
#endif

; return 0; }
configure:5220: checking for thr_getconcurrency
configure:5248: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
ld:
Unresolved:
thr_getconcurrency
configure: failed program was:
#line 5225 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char thr_getconcurrency(); 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 thr_getconcurrency();

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_thr_getconcurrency) || defined (__stub___thr_getconcurrency)
choke me
#else
thr_getconcurrency();
#endif

; return 0; }
configure:5274: checking if pthread_create() works
configure:5310: /usr/ccs/bin/cc  -o conftest -g   conftest.c  -lpthreads  1>&5
configure: failed program was:
#line 5283 "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;
#if HAVE_PTHREADS_D4
	exit(pthread_create(&t, pthread_attr_default, task, NULL));
#else
	exit(pthread_create(&t, NULL, task, NULL));
#endif
}

-- 
Hallvard
Comment 8 Kurt Zeilenga 1999-03-26 19:18:58 UTC
changed notes
changed state Test to Closed
Comment 9 OpenLDAP project 2014-08-01 21:06:52 UTC
Applied patch to configure.in and regenerated configure.