Yocto Kirkstone meta-hailo build failed

hailo-pci 4.18.0 causes errors (4.17.1 works fine)

| ERROR: modpost: module hailo_pci uses symbol dma_buf_detach from namespace DMA_BUF, but does not import it.
| ERROR: modpost: module hailo_pci uses symbol dma_buf_put from namespace DMA_BUF, but does not import it.
| ERROR: modpost: module hailo_pci uses symbol dma_buf_get from namespace DMA_BUF, but does not import it.
| ERROR: modpost: module hailo_pci uses symbol dma_buf_unmap_attachment from namespace DMA_BUF, but does not import it.
| ERROR: modpost: module hailo_pci uses symbol dma_buf_map_attachment from namespace DMA_BUF, but does not import it.
| ERROR: modpost: module hailo_pci uses symbol dma_buf_attach from namespace DMA_BUF, but does not import it.

Hi Lori,

To which host are you building this Yocto?

Hi yanivb,

my host : Ubuntu 18.04.6 LTS x86_64

Hi Lori,

Can I assume this is the host you are building the yocto on?
What is the target processor you will run on? e.g. imx8, rockchip…

Hi yanivb,

yes, my target processor is MediaTek Genio 700.

Hi Lori,

your yocto is based on kernel 5.15, so as a work around you can modify this file:
tmp/work/genio_700_evk-poky-linux/hailo-pci/4.18.0-r0/git/linux/vdma/memory.c

instead of:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
// Import DMA_BUF namespace for needed kernels
MODULE_IMPORT_NS(DMA_BUF);
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) */

set:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
// Import DMA_BUF namespace for needed kernels
MODULE_IMPORT_NS(DMA_BUF);
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) */

In order to maintain a proper yocto code management it is advised to use the relevant yocto tools (e.g. devtool).

Hi yanivb,

Thank you for your assistance.

Please note that an additional error might occur while building the tappas-apps recipe:
ERROR: Nothing PROVIDES ‘libmedialib-api’ (but /local/users/yanivb/mediatek_kirkstone/iot-yocto/src/meta-hailo/meta-hailo-tappas/recipes-gstreamer/tappas-apps/tappas-apps_3.29.1.bb DEPENDS on or otherwise
requires it)

this issue can also be worked around by commenting the following lines under:
/src/meta-hailo/meta-hailo-tappas/recipes-gstreamer/tappas-apps/tappas-apps_3.29.1.bb

python () {
#    if 'imx8' in d.getVar('MACHINE'):
        d.setVar('REQS_FILE', d.getVar('REQS_IMX8_FILE'))
        d.setVar('ARM_APPS_DIR', d.getVar('IMX8_DIR'))
#    else:
#        d.setVar('REQS_FILE', d.getVar('REQS_HAILO15_FILE'))
#        d.setVar('ARM_APPS_DIR', d.getVar('HAILO15_DIR'))
#        d.appendVar('DEPENDS', " libmedialib-api xtensor")
}