[PATCH] Fix Darwin/PPC bootstrap failure

Geoffrey Keating geoffk@apple.com
Tue Jun 13 05:42:00 GMT 2006


On 10/06/2006, at 11:01 AM, Roger Sayle wrote:

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

Did I respond to this already?

It's OK, anyway.  I checked that this compiles on Tiger and produces  
the correct error on Leopard.

> 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; }
>   ],

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2408 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060613/ad2a7b24/attachment.p7s>


More information about the Gcc-patches mailing list