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]

[Darwin PATCH]: PR libgomp/28296?!: Support -pthread on darwin


At first glance it may seem unusual that the best way to resolve
PR libgomp/28296, an alpha bootstrap failure on Tru64, is actually
to add new functionality to darwin.  But that was the outcome after
my first attempt at resolving this PR:
http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00406.html

The following patch implements Andrew Pinski's recommendation of
add -pthread support to darwin.  Rather than silently ignore this
option, it's transformed into -D_REENTRANT which is consistent with
what is done on other platforms.  Tested by bootstrap and regression
tested on i386-apple-darwin8.8.1, all default languages.  I also
checked that with this change, we can also revert some of the special
case  handling for darwin in libgomp's configure.ac, again with a full
"make bootstrap" and regression test, without any new failures
(especially in libgomp).

Although, Mike Stump has provisionally pre-approved such a change for
darwin, http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00705.html
it's probably polite to ask again in case any wants to object.

Ok for mainline?  PR28296 is actually also a 4.2 regression, so if
there are no objections it would be convenient to apply this patch
there too, so we can use the same fix as on mainline.  4.2 also?



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

	* config/darwin.h (CPP_SPEC): Handle -pthread, transforming
	it into -D_REENTRANT.


Index: config/darwin.h
===================================================================
*** config/darwin.h	(revision 118333)
--- config/darwin.h	(working copy)
*************** extern GTY(()) int darwin_ms_struct;
*** 214,220 ****
     them to darwin_cpp_builtins in darwin-c.c.  */

  #undef	CPP_SPEC
! #define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}"

  /* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus
     precomp, libtool, and fat build additions.  Also we
--- 214,221 ----
     them to darwin_cpp_builtins in darwin-c.c.  */

  #undef	CPP_SPEC
! #define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}" \
! 	" %{pthread:-D_REENTRANT}"

  /* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus
     precomp, libtool, and fat build additions.  Also we


Roger
--


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