# Compile ctld on FreeBSD 12.2 with code from FreeBSD 11.4



## Giteh (Jan 19, 2021)

I was wondering if it’s possible to compile ctld from sources 11.4 on 12.2. Simple make returns an error but maybe there is some way?
So to sum this up i want to take sources from Freebsd 11.4 and compile it on 12.2


----------



## SirDice (Jan 19, 2021)

Simple question, why?


----------



## Giteh (Jan 19, 2021)

Because I think that there is a bug in iSCSI handle in FreeBSD 12.x and want to check if it’s ctld or kernel issue.
here is link when I explain what bug is about








						iSCSI connection error on FreeBSD 12.2
					

Hi,  So I've got FreeBSD with configured iSCSI server which is serving ZFS volumes. The goal is to install some version of ESXi on this ZFS volume and then boot another machine from it using iPXE. It is booletproof soulltion - it is working for years on older versions of FreeBSD. I've got two...




					forums.freebsd.org


----------



## Mjölnir (Jan 27, 2021)

The ABI compatibility layer for FreeBSD 4 to 11 is default for the generic kernel (`config -x /boot/kernel/kernel|fgrep COMPAT`).  So if you `pkg install compat11x-amd64` on the 12.x system, the ctld(8) binary copied from your 11.x machine (or from an 11.x installation medium (for the same machine architecture)) should run... Which means that the program itself runs, but does not necessarily mean that the 12.x kernel behaves as expected  because only the newer ctld(8) of the same OS version does what the new kernel needs to behave as expected.
To compile the sources, you'll need at least the 11.x header files, maybe other parts of the 11.x sources.  You must not copy these to /usr/src on any other FreeBSD version. Instead copy them to e.g. /home/giteh/projects/freaky/fbsd-11/src.
IMHO you should ask a short e-mail on the freebsd-scsi mailing list, including kindly asking for advice how to debug your issue.
  Good luck!


----------

