Subject: Re: CVS commit: syssrc/sys/arch/powerpc/include
To: Tsubai Masanari <tsubai@iri.co.jp>
From: Matt Thomas <matt@3am-software.com>
List: tech-toolchain
Date: 08/07/2002 02:30:23
At 02:15 AM 8/7/2002, Tsubai Masanari wrote:
> >It may be intention but it's wrong.  It's incompatible with the
> >GCC 3.* definition of va_list so that if you try to build GCC 3.*
> >for powerpc, it fails in libgcc building rtl.c.
>
>But your version is incompatible with our <= 2.95 version and other
>NetBSD ports (and even it doesn't compile).  You should fix gcc instead.
>I always use gcc 3.x to compile whole NetBSD tree on powerpc rather
>than buggy 2.95.3.

Here's the diff that I applied:

*** ansi.h      2002/06/01 09:22:44     1.12
--- ansi.h      2002/08/07 00:10:29
***************
*** 60,73 ****
   #define       _BSD_SUSECONDS_T_       int             /* suseconds_t */
   #define       _BSD_USECONDS_T_        unsigned int    /* useconds_t */
   #define       _BSD_VA_LIST_           __va_list       /* va_list */
! typedef struct {
   #if __GNUC_PREREQ__(3, 0)
!       __builtin_va_list __va;
   #else
         char __gpr, __fpr, __pad[2];
         char *__stack, *__base;
- #endif
   } __va_list;

   /*
    * NOTE: rune_t is not covered by ANSI nor other standards, and should not
--- 60,74 ----
   #define       _BSD_SUSECONDS_T_       int             /* suseconds_t */
   #define       _BSD_USECONDS_T_        unsigned int    /* useconds_t */
   #define       _BSD_VA_LIST_           __va_list       /* va_list */
!
   #if __GNUC_PREREQ__(3, 0)
! typedef __builtin_va_list __va_list;
   #else
+ typedef struct {
         char __gpr, __fpr, __pad[2];
         char *__stack, *__base;
   } __va_list;
+ #endif

   /*
    * NOTE: rune_t is not covered by ANSI nor other standards, and should not

It is not compatible with GCC 2.95 because the new

typedef __builtin_va_list __va_list;

only happens on GCC 3.0 or above.  That's what the __GNUC_PREREQ__(3,0)
test is doing.  If the compiler is older than GCC 3.0, the old definition is
used.  As for it doesn't work, I bootstraped GCC 3.3 with the above diff in
place which used the 2.95 for the first stage compile without problems.

-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message