configure forces use of threads under 10.20

John David Anglin dave@hiauly1.hia.nrc.ca
Sun Oct 31 23:03:00 GMT 1999


> 
>   In message < 199910291630.MAA18044@hiauly1.hia.nrc.ca >you write:
>   > Under HP-UX 10.20, if configure finds pthread.h, it enables threads.
>   > It is not possible to disable threads in this situation.  The logic
>   > of the test is wrong.  What should be done is to disable threads if
>   > pthread.h is not found, and to require the user to explicitly enable
>   > threads (i.e., default is disabled).  I have included a small patch
>   > to correct this behaviour under gcc-2.95.2.
> Actually, I think that what GCC is doing is the desired behavior.  What
> makes you think that we should only enable thread support if the user
> has asked for it?

Two reasons:

1)	If a user installs the GNU pth package with pthreads, it installs
	a copy of pthread.h.  If gcc is configured to install with the same
	prefix, it will find pthread.h from the pth package before the
	HP DCE version.  The pth package is closer to the posix standard
	and some interface routines differ.  As a result, the gcc build
	fails.  I was surprised when I couldn't turn off using threads
	in the gcc build to avoid this problem.

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.

I wouldn't mind if the default were to have threads enabled on systems
that support them.  They could then be turned off if configure finds the
necessary resources aren't there.  However, there should still be an option
to disable them.

Dave
-- 
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