This is the mail archive of the 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] Fix Darwin/PPC bootstrap failure

The following patch resolves the current bootstrap failure on slightly
older versions of Darwin.  Geoff's recent patch to detect whether the
mcontext_t struct's field names require underscore prefixes, had a
logic error in the new configure test for HAS_MCONTEXT_T_UNDERSCORES.

On powerpc-apple-darwin7.9.0, the test case:

#include <ucontext.h>
int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; }

Fails with a compilation error in sys/ucontext.h as the type/identifier
sigset_t isn't defined.  It appears on some darwin releases <ucontext.h>
can't be #included directly.  This compilation failure is then
misinterpreted by configure to indicate that the fields require the
double underscore prefix, i.e. __ss instead of ss.

My first attempt at a fix was to #include <sys/types.h> but this doesn't
declare/define siset_t either, so instead the proposed patch below is to
instead #include <sys/signal.h>.  Hopefully, this is portable across all
relevant Darwin versions.  I unfortunately only have access to a single
darwin box at present.

The following patch has been tesed on powerpc-apple-darwin7.9.0 with a
full "make bootstrap", which now proceeds past the previous failure
building rs6000/host-darwin.c during stage1.

Ok for mainline?

2006-06-10  Roger Sayle  <>

	* (HAS_MCONTEXT_T_UNDERSCORES): Include <sys/signal.h>
	before <ucontext.h> to define sigset_t required by <sys/ucontext.h>.
	* configure: Regenerate.

***	(revision 114540)
---	(working copy)
*************** case ${host} in
*** 1348,1353 ****
--- 1348,1354 ----
      AC_CACHE_CHECK([whether mcontext_t fields have underscores],
+ #include <sys/signal.h>
  #include <ucontext.h>
  int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; }


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