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]

Re: 3.1 PATCH: Fix Solaris 2.5.1 <widec.h> to avoid bootstrap failure



> Btw., make check reveals an unrelated failure right now:
> 
> testing.h $root/fixinc/tests/base/testing.h differ: char 1716, line 74
> --- testing.h   Mon Apr 29 21:35:58 2002
> +++ $root/fixinc/tests/base/testing.h  Mon Jan  7 19:37:19 2002
> @@ -71,7 +71,7 @@
>  
>  #if defined( MACHINE_NAME_CHECK )
>  /* MACH_DIFF: */
> -#if defined( i386 ) || defined( __sparc__ ) || defined( vax )
> +#if defined( __i386__ ) || defined( sparc ) || defined( vax )
>  /* no uniform test, so be careful  :-) */
>  #endif  /* MACHINE_NAME_CHECK */

It seems you were not running on a sparc platform, but rather an i386.
Note the comment, "no uniform test, so be careful  :-)"  :-)

So, not having time now to check it out, my best guess is that the
following patch will make it work correctly on i386, sparc and vax
platforms.  The sed script should only work on the relevant line and
then only if one machine name is properly prefixed by underscores.

If it works, we can apply it and add new machines as developers
complain.

$ cvs diff -u check.tpl                
Index: check.tpl
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/check.tpl,v
retrieving revision 1.14
diff -u -u -r1.14 check.tpl
--- check.tpl   27 May 2001 18:21:02 -0000      1.14
+++ check.tpl   29 Apr 2002 20:41:35 -0000
@@ -117,6 +117,13 @@
 sed 's/\(#define __[A-Z_]*_TYPE__\).*/\1/' sys/types.h > XX
 mv -f XX sys/types.h
 
+#  Special hack for testing.h:  each platform changes only those
+#  ``#ifdef platform'' entries to ``#ifdef __platform__'' that are
+#  relevant.  Patch the file to make it consistant for all platforms.
+#
+sed 's/^#if defined.*( __.*vax_* )$/#if defined( __PLATFORM__ )/'
testing.h > XX
+mv -f XX testing.h
+
 #  The following subshell weirdness is for saving an exit
 #  status from within a while loop that reads input.  If you can
 #  think of a cleaner way, suggest away, please...


===================================================================

> Mark Mitchell writes:
> 
> > > +fix = {
> > > +    hackname  = solaris_widec;
> > > +    files     = widec.h;
> > > +    mach      = '*-*-solaris*';
> > 
> > Can we use "*-*-solaris2.[0-5]*" here instead?  That would reduce the
> > risk of the patch; there is no need for it to apply to later versions.
> 
> This came to my mind after submitting the patch, although the bypass on
> wchar.h should avoid this.  Anyway, better safe than sorry ...

This fix is applied if:

1.  the file is named "widec.h"
2.  It contains "#include <euc.h>"
3.  It does not contain "#include <wchar.h>"

and also:

4.  The platform is a "solaris2.[0-5]"

I'm pretty sure it's not needed, but it only adds one round-trip message
to the server shell per fixincl invocation, not per file.  Pretty cheap.


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