# Kernel build fails on 8.0 without COMPAT_FREEBSD7



## SirDice (Dec 7, 2009)

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


```
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?


----------



## SirDice (Dec 7, 2009)

This looks like it's related:
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/141090&cat=


----------



## SirDice (Dec 7, 2009)

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.


----------



## DutchDaemon (Dec 7, 2009)

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.


----------



## SirDice (Dec 7, 2009)

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.


----------



## phoenix (Dec 7, 2009)

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.


----------



## SirDice (Dec 7, 2009)

Weird, on my 'old' 7.2-stable I've always had COMPAT_FREEBSD5 but never COMPAT_FREEBSD6. Is this something new in 8?


----------



## graudeejs (Dec 7, 2009)

what for do you need COMPAT_FREEBSD5?

I only leave COMPAT_FREEBSD[red]_CurrentVersion-1_[/red]


----------



## SirDice (Dec 7, 2009)

killasmurf86 said:
			
		

> what for do you need COMPAT_FREEBSD5?


NVidia driver.


----------



## DutchDaemon (Dec 7, 2009)

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.


----------

