Subject: kern/25294: sys/netinet/ip_rules.c fails to build on vax in -current and netbsd-2-0
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mhitch@netbsd.org>
List: netbsd-bugs
Date: 04/23/2004 14:46:35
>Number:         25294
>Category:       kern
>Synopsis:       sys/netinet/ip_rules.c fails to build on vax in -current and netbsd-2-0
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 23 20:47:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Michael L. Hitch
>Release:        NetBSD 2.0D
>Organization:
	
>Environment:
	
	
System: NetBSD netbsd0 1.6ZC NetBSD 1.6ZC (GENERIC.MP) #2: Sun Nov 16 21:57:32 MST 2003 mhitch@netbsd2.msu.montana.edu:/usr/NetBSD-current/obj/alphaev56/sys/arch/alpha/compile.alpha/GENERIC.MP alpha
Architecture: alpha
Machine: alpha
>Description:
	The import of ipfilter 4.1.1 fails to build on a vax for both -current (2.0D)
	and the netbsd-2-0 branch.

#   compile  GENERIC/ip_rules.o
/usr/NetBSD-current/tools.alpha/bin/vax--netbsdelf-gcc -mno-asm-pic -ffreestanding -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -Wno-uninitialized -D_VAX_INLINE_ -I. -I/usr/NetBSD-current/src/sys/arch -I/usr/NetBSD-current/src/sys -nostdinc -DLKM -DMAXUSERS=8 -D_KERNEL -D_KERNEL_OPT -c /usr/NetBSD-current/src/sys/netinet/ip_rules.c
cc1: warnings being treated as errors
In file included from machine/param.h:171,
                 from /usr/NetBSD-current/src/sys/sys/param.h:143,
                 from /usr/NetBSD-current/src/sys/netinet/ip_rules.c:18:
machine/macros.h:45: warning: static declaration for `ffs' follows non-static
machine/macros.h:60: warning: static declaration for `_remque' follows non-static
machine/macros.h:69: warning: static declaration for `_insque' follows non-static
machine/macros.h:78: warning: static declaration for `memcpy' follows non-static
machine/macros.h:91: warning: static declaration for `memmove' follows non-static
machine/macros.h:116: warning: static declaration for `memset' follows non-static
machine/macros.h:295: warning: static declaration for `scanc' follows non-static
machine/macros.h:308: warning: static declaration for `skpc' follows non-static

*** Failed target:  ip_rules.o

	The problem is due to including sys/system.h, which defines several functions
	which are later defined differently when sys/param.h is included.  These
	functions are defined as macros generating the vax machine instructions
	representing those functions.
>How-To-Repeat:
	Checkout a -current source tree, or a netbsd-2-0 branch tree and attempt
	a build for vax.
>Fix:
	The following patch resulted in a clean compile for the vax, but I don't
	know if there would be problems for other architectures.

Index: ip_rules.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/ip_rules.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ip_rules.c
--- ip_rules.c	28 Mar 2004 08:56:49 -0000	1.1.1.1
+++ ip_rules.c	23 Apr 2004 20:25:33 -0000
@@ -11,7 +11,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/socket.h>
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sgi)
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sgi) && !defined(__NetBSD__)
 # include <sys/systm.h>
 #endif
 #include <sys/errno.h>
>Release-Note:
>Audit-Trail:
>Unformatted: