Kernel build fails on 8.0 without COMPAT_FREEBSD7

SirDice

Administrator
Staff member
Administrator
Moderator
It seems the option SYSVMSG needs COMPAT_FREEBSD7. If you remove COMPAT_FREEBSD7 from GENERIC kernel it fails to build:

Code:
cc -c -O -pipe  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline 
-Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL 
-DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-
growth=1000  -mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-
protector -Werror  /usr/src/sys/kern/sysv_msg.c
/usr/src/sys/kern/sysv_msg.c:1263: error: invalid application of 'sizeof' to incomplete type 'struct freebsd7_msgctl_args'
/usr/src/sys/kern/sysv_msg.c:1263: error: 'freebsd7_msgctl' undeclared here (not in a function)
cc1: warnings being treated as errors
/usr/src/sys/kern/sysv_msg.c:1309: warning: function declaration isn't a prototype
/usr/src/sys/kern/sysv_msg.c: In function 'freebsd7_msgctl':
/usr/src/sys/kern/sysv_msg.c:1318: error: dereferencing pointer to incomplete type
/usr/src/sys/kern/sysv_msg.c:1318: error: request for member 'cmd' in something not a structure or union
/usr/src/sys/kern/sysv_msg.c:1318: warning: comparison between pointer and integer
/usr/src/sys/kern/sysv_msg.c:1319: error: dereferencing pointer to incomplete type
/usr/src/sys/kern/sysv_msg.c:1319: error: request for member 'buf' in something not a structure or union
/usr/src/sys/kern/sysv_msg.c:1334: error: dereferencing pointer to incomplete type
/usr/src/sys/kern/sysv_msg.c:1334: error: request for member 'msqid' in something not a structure or union
/usr/src/sys/kern/sysv_msg.c:1334: error: dereferencing pointer to incomplete type
/usr/src/sys/kern/sysv_msg.c:1334: error: request for member 'cmd' in something not a structure or union
/usr/src/sys/kern/sysv_msg.c:1334: warning: passing argument 2 of 'kern_msgctl' makes integer from pointer without a cast
/usr/src/sys/kern/sysv_msg.c:1334: warning: passing argument 3 of 'kern_msgctl' makes integer from pointer without a cast
/usr/src/sys/kern/sysv_msg.c:1337: error: dereferencing pointer to incomplete type
/usr/src/sys/kern/sysv_msg.c:1337: error: request for member 'cmd' in something not a structure or union
/usr/src/sys/kern/sysv_msg.c:1337: warning: comparison between pointer and integer
/usr/src/sys/kern/sysv_msg.c:1350: error: dereferencing pointer to incomplete type
/usr/src/sys/kern/sysv_msg.c:1350: error: request for member 'buf' in something not a structure or union
*** Error code 1

Stop in /usr/obj/usr/src/sys/TEST.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.

Why is SYSVMSG dependent on COMPAT_FREEBSD7?
 
Ok.. If you remove all the COMPAT_FREEBSD? options kernel builds fine. If any of them are set you also seem to need COMPAT_FREEBSD7.
 
Heh. Weird. Like you need to chainload them (if you use 5, better use 6 and 7 as well) .. I had compat5 in there for nvidia blob, and that was fine on its own on 8.0-i386 when I first installed it.
 
Yeah, on one system I needed COMPAT_FREEBSD5 for NVidia too. I also seem to need COMPAT_FREEBSD6 for diablo. Thought I could do without COMPAT_FREEBSD7, guess not :(

On my server everything builds fine as that one doesn't need COMPAT_* at all.

And it seems it's only SYSVMSG that breaks. I had a look at the source code and moved a #endif around, lets see what happens.
 
See the NOTES file on an 8.x system. It mentions the upward dependecies (COMPAT_FREEBSDX needs COMPAT_FREEBSDX+1, and so on). It's worded really funny, but that's the gist of it.
 
Weird, on my 'old' 7.2-stable I've always had COMPAT_FREEBSD5 but never COMPAT_FREEBSD6. Is this something new in 8?
 
To be exact: the 32-bit NVIDIA driver, which is binary compatible with FreeBSD 5 only. The new 64-bit one doesn't need any compat as its built against FreeBSD 8. In fact, I've taken them all out, except the 4.3 and ia32 ones. I'm not sure whether I need 32-bit compatibility anymore, but the linuxulator is still i386, so I guess I'll need it for that.
 
Back
Top