Subject: Re: Build failure - port amd64 - ip_auth.o
To: None <current-users@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: current-users
Date: 05/03/2007 13:25:40
On Thu, May 03, 2007 at 01:00:30PM -0500, David Young wrote:
> On Thu, May 03, 2007 at 07:14:22AM -0700, Paul Goyette wrote:
> > >From sources updated via CVS just recently (Thu May  3 12:25:32 UTC 2007)
> > Not sure if this affects other ports or not - my i386 build is still 
> > running...
> > 
> > #   compile  GENERIC.MP/ip_auth.o
> > /usr/obj/tooldir/x86_64/amd64/bin/x86_64--netbsd-gcc -mcmodel=kernel 
> > -mno-red-zone -ffreestanding -fno-zero-initialized-in-bss -O2 -Werror -Wall 
> > -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes 
> > -Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual -Wwrite-strings 
> > -Wno-sign-compare -Wno-pointer-sign -Wno-attributes -fno-strict-aliasing
> > -Damd64 -Dx86_64 -I. -I/usr/src/sys/contrib/dev/ath/netbsd
> > -I/usr/src/sys/../common/include -I/usr/src/sys/arch -I/usr/src/sys
> > -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT
> > -I/usr/src/sys/lib/libkern/../../../common/lib/libc/quad 
> > -I/usr/src/sys/lib/libkern/../../../common/lib/libc/string 
> > -I/usr/src/sys/lib/libkern/../../../common/lib/libc/arch/x86_64/string
> > -I/usr/src/sys/dist/ipf -c /usr/src/sys/dist/ipf/netinet/ip_auth.c
> > cc1: warnings being treated as errors
> > In file included from /usr/src/sys/net/netisr.h:90,
> >                  from /usr/src/sys/dist/ipf/netinet/ip_auth.c:107:
> > /usr/src/sys/netiso/iso.h: In function 'sockaddr_iso_init1':
> > /usr/src/sys/netiso/iso.h:206: warning: cast from pointer to integer of 
> > different size
> > /usr/src/sys/netiso/iso.h:209: warning: cast from pointer to integer of 
> > different size
> > *** [ip_auth.o] Error code 1
> 
> I use offsetof() at both of those lines.  Doesn't offsetof() work
> on amd64?  Perhaps a broken definition in netiso/ shadows a working
> definition elsewhere?

I guess it is IP Filter's definition of offsetof(),

% grep '^#define[[:space:]]\+offsetof(' ../../dist/ipf/netinet/*
../../dist/ipf/netinet/ip_fil.h:#define offsetof(t,m)   (int)((&((t *)0L)->m))

Maybe if you add lines such as this somewhere at the top of ip_fil.h
or ip_compat.h?

/* For offsetof() */
#if defined(_KERNEL) || defined(_STANDALONE)
#include <sys/systm.h>
#else
#include <stddef.h>
#endif

Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933