This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR libgomp/28296: Bootstrap failure on Tru64


The following patch resolves PR libgomp/28296 which a boostrap failure
on alphaev67-dec-osf5.1 triggered by Eric Christopher's 2006-07-05
change to libgomp's configure.ac to avoid the use of -pthread on darwin.
http://gcc.gnu.org/viewcvs?view=rev&revision=115205

Unfortunately, that change contained two mistakes: the first is that
it removed -pthread from $CFLAGS on all platforms (it's necessary on
those that require _REENTRANT to be defined to get the pthreads APIs),
and the second was that it used "default)" in a case statement instead
of "*)" thereby disabling the setting of XPCFLAGS on all non-darwin
platforms.

The change below has been tested on alphaev67-dec-osf5.1 where it
allows a default bootstrap, except for java, to complete without
problems.

Ok for mainline?



2006-09-11  Roger Sayle  <roger@eyesopen.com>

	PR libgomp/28296
	* configure.ac: Fix the platform dependent use of -pthread in
	configure tests.
	* configure: Regenerate.


Index: configure.ac
===================================================================
*** configure.ac	(revision 116840)
--- configure.ac	(working copy)
*************** GCC_HEADER_STDINT(gstdint.h)
*** 146,152 ****
--- 146,162 ----
  # In case the pthread.h system header is not found, this test will fail.
  XPCFLAGS=""

+ # Some plaforms require -pthread in the following configure tests otherwise
+ # they'll fail to detect the system supports POSIX pthreads (i.e. Tru64).
  # Darwin doesn't need the -pthread option since threads are in libSystem
+ case "$host" in
+   *-darwin*)
+     ;;
+   *)
+     CFLAGS="$CFLAGS -pthread"
+     ;;
+ esac
+
  AC_LINK_IFELSE(
   [AC_LANG_PROGRAM(
    [#include <pthread.h>
*************** AC_LINK_IFELSE(
*** 155,161 ****
   [case $host in
     *-darwin*)
       ;;
!    default)
       XPCFLAGS=" -Wc,-pthread"
       ;;
       esac],
--- 165,171 ----
   [case $host in
     *-darwin*)
       ;;
!    *)
       XPCFLAGS=" -Wc,-pthread"
       ;;
       esac],


Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]