# Curious case of COMPAT_FREEBSD6 requiring COMPAT_FREEBSD7 for kernel build



## trev (Aug 16, 2019)

FreeBSD 11.3-STABLE #7 r349943

As I have an issue with the bootstrap compiler for the Free Pascal port core dumping with:

```
compat6.mmap()                                   ERR#78 'Function not implemented'
SIGNAL 12 (SIGSYS) code=SI_KERNEL
process killed, signal = 12 (core dumped)
```
I decided to include "options COMPAT_FREEBSD6" in addition to my "options COMPAT_FREEBSD10".

However, that led to the kernel build failing unless I also included "options COMPAT_FREEBSD7".

Curious.


----------



## SirDice (Aug 16, 2019)

It's not. You need to add all the intermediate versions too. COMPAT_FREEBSD6 is for running FreeBSD 6 binaries on 7. COMPAT_FREEBSD7 is for running 7 binaries on 8. etc. For 6 you need to include 6, 7, 8, 9 and 10.

The same is true for the accompanied misc/compat6x, you also need misc/compat7x, misc/compat8x, etc.


----------



## trev (Aug 16, 2019)

Well then, it's even more curious because including only COMPAT6, 7 and 10 resolved my issues - that is the kernel build and boots successfully and the miscreant bootstrap fpc compiler no longer core dumps and compiles Pascal programs successfully.

Previously I had only COMPAT10 in the kernel.


----------



## SirDice (Aug 16, 2019)

There may not have been many API changes between 7, 8 and 9. So it _builds_ cleanly. But that's no guarantee it _works_ correctly. I've had kernel configurations that would build just fine, but paniced every couple of minutes.


----------

