configure forces use of threads under hpux 10.20

John David Anglin dave@hiauly1.hia.nrc.ca
Tue Apr 4 21:03:00 GMT 2000


Forwarded message:
>From dave Tue Apr 4 23:43:13 EDT 2000
Subject: Re: configure forces use of threads under hpux 10.20
To: law@cygnus.com
Date: Tue, 4 Apr 2000 23:43:13 -0400 (EDT)
From: "John David Anglin" <dave@hiauly1>
In-Reply-To: <6872.943343586@upchuck> from "Jeffrey A Law" at Nov 23, 1999 00:53:06 am
X-Mailer: ELM [version 2.4 PL25]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 2187      

>   > 2)	Again stretching the limits of what possibly works, I did a build
>   > 	of gcc with --enable-shared.  In this case pthread.h from the pth
>   > 	package was moved to a directory where gcc wouldn't find it.
>   > 	However, DCE threads were installed.  There were a lot of failures
>   > 	when a I did "make check" because it didn't link with libcma,
>   > 	etc.
> Yes.  This is a general problem with our threading support -- the need to
> link in additional libraries.  I'm still waiting for someone to propose a
> solution to this problem.  Simply disabling threads is not the solution.

I have looked at this problem further and have found a simple resolution.
HP-UX 10.20 uses a multilib implementation for threads.  The need to link
in additional libraries is due to the fact that thread_file is set to
`dce' for the default version of libgcc.a.  The default thread_file should
be `single'.  I have successfully built and checked gcc (both with and
without threads) using the following patch to configure.in.  It is
relative to the gcc-2.95 branch but it should also be usable with the
main branch.  I have changed the test to a case statement with the
thought that other thread implementations might be supported in the future.

-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

--- configure.in.orig	Tue Dec 28 15:23:34 1999
+++ configure.in	Tue Apr  4 14:05:40 2000
@@ -943,10 +943,11 @@
 		if test x$enable_threads = x; then
 		    enable_threads=$have_pthread_h
 		fi
- 		if test x$enable_threads = xyes; then
-			thread_file='dce'
+ 		case x${enable_threads} in
+		xyes | xdce)
 			tmake_file="${tmake_file} pa/t-dce-thr"
-		fi
+			;;
+		esac
 		install_headers_dir=install-headers-cpio
 		use_collect2=yes
 		;;
@@ -962,10 +963,11 @@
 		if test x$enable_threads = x; then
 		    enable_threads=$have_pthread_h
 		fi
- 		if test x$enable_threads = xyes; then
-			thread_file='dce'
+ 		case x${enable_threads} in
+		xyes | xdce)
 			tmake_file="${tmake_file} pa/t-dce-thr"
-		fi
+			;;
+		esac
 		install_headers_dir=install-headers-cpio
 		use_collect2=yes
 		;;


-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


More information about the Gcc-bugs mailing list