Subject: Re: i386->vax build fails
To: None <current-users@NetBSD.org>
From: Aaron J. Grier <agrier@poofygoof.com>
List: current-users
Date: 07/03/2006 15:15:01
On Sat, Jul 01, 2006 at 09:41:16PM -0700, Ben Collver wrote:
> Justy FYI, when I tried to build a -current vax release on an i386
> host, it failed in GENERIC/assym.h

I'm getting this here too...  just when I have a 4000/VLC to hack on
too.  :(

> In file included from machine/param.h:171,
>                  from /home/ben/src/netbsd/current/src/sys/sys/param.h:145,
>                  from /tmp/genassym.27152/assym.c:2:
> machine/macros.h:45: warning: static declaration for `ffs' follows non-static
[...]

src/sys/lib/libkern/libkern.h has:
> /*
>  * ffs is an instruction on vax.
>  */ 
> int      ffs __P((int));
> #if __GNUC_PREREQ__(2, 95) && !defined(__vax__)
> #define ffs(x)                  __builtin_ffs(x)
> #endif

which is where assym is getting it.

but in machine/macros.h:

> /* Here general macros are supposed to be stored */
> 
> static __inline int __attribute__((__unused__))
> ffs(int reg)
> {

it's redeclared as static, and so gcc is complaining.

vax doesn't want gcc's builtins, but

#if __GNUC_PREREQ__(2, 95)
#define ffs(x)			__builtin_ffs(x)
#endif

generates "warning: shadowing built-in function".

-- 
  Aaron J. Grier | "Not your ordinary poofy goof." | agrier@poofygoof.com
              "silly brewer, saaz are for pils!"  --  virt