[PATCH] Fix Darwin/PPC bootstrap failure
Roger Sayle
roger@eyesopen.com
Sat Jun 10 18:20:00 GMT 2006
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 <roger@eyesopen.com>
* configure.ac (HAS_MCONTEXT_T_UNDERSCORES): Include <sys/signal.h>
before <ucontext.h> to define sigset_t required by <sys/ucontext.h>.
* configure: Regenerate.
Index: configure.ac
===================================================================
*** configure.ac (revision 114540)
--- configure.ac (working copy)
*************** case ${host} in
*** 1348,1353 ****
--- 1348,1354 ----
AC_CACHE_CHECK([whether mcontext_t fields have underscores],
gcc_cv_mcontext_underscores,
AC_COMPILE_IFELSE([
+ #include <sys/signal.h>
#include <ucontext.h>
int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; }
],
Roger
--
More information about the Gcc-patches
mailing list