Subject: -current & gcc
To: None <amiga-dev@NetBSD.ORG>
From: None <mduponch@cisco.com>
List: amiga-dev
Date: 02/14/1995 10:49:10
hello current users & amiga dev

On my way from 1.0 to -current I received much help from you people:

Thanks.

Yesterday (after my 3rd try to *rebuild everything*) I came to the
following constatation:

I believe (but can't yet prove, my amiga is doing it all over again)
that one *really* needs the NetBSD supplied compiler (2.4.5) in order
to make correct targets.

If this would be so then, personally, I would find this a pity. As
indicated below the effort in upgrading is probabably not very big.

I came to the 'constatation' as follows:

- I used gcc 2.6.2 and
-- compiled -current kernel
-- booted from -current kernel
-- compiled ps (since old one did not work anymore)
-- compiled and installed lib **** oops **** libc.so gave the following trouble:

main() { printf("%d\n", 12345); } prints 1 (i.s.o. 12345)

I looked at vfprintf.c and found possible indications for the 'problem'

vfprintf.c uses:

#ifdef __GNUC__			/* gcc has builtin quad type (long long) SOS */
#define	quad_t	  long long
#define	u_quad_t  unsigned long long
#endif

and:

#define	SARG() \
	(flags&QUADINT ? va_arg(ap, quad_t) : \
	    flags&LONGINT ? va_arg(ap, long) : \
	    flags&SHORTINT ? (long)(short)va_arg(ap, int) : \
	    (long)va_arg(ap, int))
#define	UARG() \
	(flags&QUADINT ? va_arg(ap, u_quad_t) : \
	    flags&LONGINT ? va_arg(ap, u_long) : \
	    flags&SHORTINT ? (u_long)(u_short)va_arg(ap, int) : \
	    (u_long)va_arg(ap, u_int))

First of all, *somebody* must have had a reason to put the 'SOS' there
:-) Second, I am not sure if all cpp versions of gnu handle nested
macros equally well.  Third, I certainly don't know if all cc1 versions
handle long long equally well.

Of course, these are minor problems and if the *only* compiler version dependencies
would be that easy, why not try to upgrade ?

Another question: why did people use #define in the first place i.s.o.

typedef long long quad_t;
typedef unsigned long long u_quad_t;

I asked myself this question too late (after a 'make clean' on lib, see
below). maybe that's all there is to get it going (I *will* check this
later).

I build the compiler that came with NetBSD and I will build everything
from scratch again.


 Greetings,

-- marc.                  \|||/
                          (o o)
+----------------------ooO-(.)-Ooo----------------------------------------+
|                                       |  Cisco Systems Belgium NV/SA    |
|         |          |                  |  Complex Antares                |
|        |||        |||                 |  71, Avenue des Pleiades        |
|       |||||      |||||                |  B-1200 Brussels                |
|   ..:|||||||:..:|||||||:..            |  --------------                 |
|                                       |  BELGIUM EUROPE                 |
|---- Cisco Systems Europe -------------+---------------------------------|
|                                       |                                 |
|      Brussels MIS Team                | alias:  brussels-mis@cisco.com  |
|      -------- --- ----                |                                 |
|       Marc Duponcheel                 | v-mail:    +32 2 778 42 40      |
|         MIS analyst                   | e-mail: mduponch@cisco.com      |
+------------------------------------>8-----------------------------------+