Subject: kern/22968: amd64 GENERIC.MP -current kernel build broken with COMPAT_NETBSD32 set
To: None <gnats-bugs@gnats.netbsd.org>
From: None <njoly@pasteur.fr>
List: netbsd-bugs
Date: 09/26/2003 19:43:48
>Number:         22968
>Category:       kern
>Synopsis:       amd64 GENERIC.MP -current kernel build broken with COMPAT_NETBSD32 set
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 26 17:44:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Nicolas Joly
>Release:        NetBSD 1.6ZC (-current)
>Organization:
	Pasteur Institute, Paris.
>Environment:
System: NetBSD calimero.bis.pasteur.fr 1.6ZC NetBSD 1.6ZC (GENERIC.MP) #1: Fri Sep 26 18:21:24 CEST 2003 njoly@calimero.bis.pasteur.fr:/local/src/NetBSD/objs/local/src/NetBSD/src/sys/arch/amd64/compile/GENERIC.MP amd64
Architecture: x86_64
Machine: amd64
>Description:

	Since recent `sigset_t * -> const sigset_t *' changes, the amd64
GENERIC.MP kernel does not compile anymore. It seems that arch specific
files for compat netbsd32 were forgotten.

njoly@calimero [NetBSD/src]> ./build.sh -uU -D ../dest -M ../objs -T ../tools kernel=GENERIC.MP
[...]
/local/src/NetBSD/chain/bin/x86_64--netbsd-gcc  -mcmodel=kernel -mno-red-zone  -ffreestanding  -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -Wno-uninitialized  -Damd64 -Dx86_64 -I.  -I/local/src/NetBSD/src/sys/arch -I/local/src/NetBSD/src/sys -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT   -c /local/src/NetBSD/src/sys/compat/netbsd32/netbsd32_netbsd.c
/local/src/NetBSD/src/sys/compat/netbsd32/netbsd32_netbsd.c:127: warning: initialization from incompatible pointer type

*** Failed target:  netbsd32_netbsd.o

>How-To-Repeat:
	Try to build a GENERIC.MP kernel with COMPAT_NETBSD32 option enabled.
>Fix:

The fix for amd64 is provided, but other archs may be affected as well.

Index: sys/arch/amd64/amd64/netbsd32_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/amd64/netbsd32_machdep.c,v
retrieving revision 1.3
diff -u -r1.3 netbsd32_machdep.c
--- sys/arch/amd64/amd64/netbsd32_machdep.c	2003/07/14 23:32:31	1.3
+++ sys/arch/amd64/amd64/netbsd32_machdep.c	2003/09/26 16:20:09
@@ -124,7 +124,7 @@
 }
 
 void
-netbsd32_sendsig(int sig, sigset_t *mask, u_long code)
+netbsd32_sendsig(int sig, const sigset_t *mask, u_long code)
 {
 	struct lwp *l = curlwp;
 	struct proc *p = l->l_proc;
Index: sys/arch/amd64/include/netbsd32_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/include/netbsd32_machdep.h,v
retrieving revision 1.1
diff -u -r1.1 netbsd32_machdep.h
--- sys/arch/amd64/include/netbsd32_machdep.h	2003/04/26 18:39:45	1.1
+++ sys/arch/amd64/include/netbsd32_machdep.h	2003/09/26 16:20:09
@@ -120,7 +120,7 @@
 struct exec_package;
 void netbsd32_setregs(struct lwp *l, struct exec_package *pack, u_long stack);
 int netbsd32_sigreturn(struct lwp *l, void *v, register_t *retval);
-void netbsd32_sendsig(int sig, sigset_t *mask, u_long code);
+void netbsd32_sendsig(int sig, const sigset_t *mask, u_long code);
 
 extern char netbsd32_sigcode[], netbsd32_esigcode[];
 
>Release-Note:
>Audit-Trail:
>Unformatted: