List:General Discussion« Previous MessageNext Message »
From:Sinisa Milivojevic Date:March 16 2002 12:42pm
Subject:Re: Bad pthreads detection on Tru64 5.1a
View as plain text  
Dan Nelson writes:
> >Description:
> 
> 	Tru64 5.1a is more strict than other versions of Tru64 when
> compiling a threaded program.
> 
> extract of pthreads.h file on Tru64 5.1:
> 
> 	/*
> 	 * Enable reentrant errno.h. HOWEVER: this is here only to avoid breaking old
> 	 * (and incorrect) code that assumes it's here. This will only work if
> 	 * <pthread.h> is the first header file included, and it is always far better
> 	 * to avoid such assumptions. You should always define _REENTRANT on the
> 	 * command line, usually by using "cc -pthread" or "cxx -pthread", to be sure
> 	 * that it will be available for all header files.
> 	 */
> 	#ifdef _PTHREAD_ENV_UNIX
> 	# ifndef _REENTRANT
> 	#  define _REENTRANT	1
> 	# endif
> 	#endif
> 
> extract of pthreads.h file on Tru64 5.1a:
> 
> 	#ifdef _PTHREAD_ENV_UNIX
> 	# ifndef _REENTRANT
> 	#  error "Please compile the module including pthread.h with -pthread"
> 	# endif
> 	#endif
> 
> 	
> >How-To-Repeat:
>    ./configure , then notice that mit-pthreads is getting built
> 	
> >Fix:
>    
> --- configure.in~	Thu Mar 14 16:40:46 2002
> +++ configure.in	Thu Mar 14 16:40:46 2002
> @@ -907,6 +907,8 @@
>  	then
>  	  with_named_thread="-lpthread -lmach -lexc"
>  	  #with_named_thread="-lpthread -lmach -lexc -lc"
> +	  CFLAGS="$CFLAGS -D_REENTRANT"
> +	  CXXFLAGS="$CXXFLAGS -D_REENTRANT"
>  	  AC_DEFINE(HAVE_DEC_THREADS)
>  	  AC_MSG_RESULT("yes")
>  	else
 
Hi!

Thank you for your contribution. 

-- 
Regards,
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Sinisa Milivojevic <sinisa@stripped>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
       <___/   www.mysql.com

Thread
Bad pthreads detection on Tru64 5.1aDan Nelson15 Mar
  • Re: Bad pthreads detection on Tru64 5.1aSinisa Milivojevic16 Mar