Subject: Re: -current amd64 kernel compilation failure with COMPAT_NETBSD32
To: NetBSD amd64 <port-amd64@NetBSD.org>
From: Nicolas Joly <njoly@pasteur.fr>
List: port-amd64
Date: 10/04/2005 16:01:50
On Tue, Sep 27, 2005 at 09:12:21AM -0400, Gary Duzan wrote:
> In Message <20050927120817.GA27323@lanfeust.sis.pasteur.fr> ,
>    Nicolas Joly <njoly@pasteur.fr> wrote:
> 
> =>I just updated my -current sources and noticed that amd64 kernels with
> =>COMPAT_NETBSD32 does not compile anymore :
> =>
> =>#    create  GENERIC.MP/assym.h
> =>cat /local/src/NetBSD/src/sys/arch/amd64/amd64/genassym.cf  |  /local/src/NetBSD/tool/amd64/bin/nbgenassym -- /local/src/NetBSD/tool/amd6
> 4/bin/x86_64--netbsd-gcc  -mcmodel=kernel -mno-red-zone  -ffreestanding   -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-ari
> th -Wmissing-prototypes -Wstrict-prototypes -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare  -fno-zero-initia
> lized-in-bss    -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  -I/local/src/NetBSD/src/sys/dist/ipf   > assym.h.tmp &&  mv -f assym.h.tmp assym.h
> =>In file included from /tmp/genassym.7332/assym.c:23:
> =>machine/netbsd32_machdep.h:86: error: parse error before "siginfo32_t"
> =>machine/netbsd32_machdep.h:86: warning: no semicolon at end of struct or union
> =>machine/netbsd32_machdep.h:88: error: parse error before '}' token
> 
>    I can confirm this. A bit of hackery (included below) got it
> going again, though I don't claim correctness, and the 32 bit
> compatability doesn't seem that great. ("ls" works, but not a lot
> else.)

Wow! A simple `hello world' program does not work anymore ...

njoly@lanfeust [~]> file emul/netbsd32/hello 
emul/netbsd32/hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for NetBSD 2.0D, dynamically linked (uses shared libs), not stripped
njoly@lanfeust [~]> ./emul/netbsd32/hello 
fstat: /etc/ld.so.conf: Cannot allocate memory
zsh: segmentation fault (core dumped)  ./emul/netbsd32/hello
njoly@lanfeust [~]> ktruss ./emul/netbsd32/hello
   685 ktruss   emul(netbsd)
   685 ktruss   fcntl(0x4, 0x3, 0)                 = 1
   685 ktruss   fcntl(0x4, 0x4, 0x1)               = 0
   685 hello    emul(netbsd32)
   685 hello    netbsd32_execve("./emul/netbsd32/hello", 0x7f7fffffeb40, 0x7f7fffffeb50) JUSTRETURN
   685 hello    netbsd32___sysctl(0xffffffffffffd92c, 0x2, 0xffffffff880532c0, 0xffffffffffffd928, 0, 0) = 0
   685 hello    netbsd32_mmap(0, 0x8000, 0x3, 0x1002, 0xffffffffffffffff, 0, 0, 0) = 0x88055000
   685 hello    geteuid()                          = 1000
   685 hello    getuid()                           = 1000
   685 hello    getegid()                          = 100
   685 hello    getgid()                           = 100
   685 hello    netbsd32_open("/emul/netbsd32/etc/ld.so.conf", 0, 0) = 3
   685 hello    netbsd32___fstat13(0x3, 0xffffffffffffdaf0) = 0
   685 hello    netbsd32_mmap(0, 0, 0x3, 0x2, 0x3, 0, 0, 0) = 0x88049000
   685 hello    netbsd32_close(0x3)                = 0
   685 hello    netbsd32_munmap(0xffffffff88049000, 0) = 0
   685 hello    SIGSEGV SIG_DFL

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.