I'm building an embedded system which uses a mcpie-to-can board.
The motherboard is a Intel J1900 based mother board (so x86_64 processor type).
I added a recipe to my layer but build of "peak-linux-driver-8.5.1.tar.gz" failed.
The first time, it failed because the popt.h file was not found.
I followed the advice given in this thread .. That's the reason of the do_compile function.
(see below)
Now, when compiling with this recipe, the process fails with the following error: implicit declaration of function 'pci_enable_msi_range'; did you mean 'pci_enable_msix_range'?
Moreover, it seems that the makefile will create a cross-compiled module because it assumes that the system running the makefile is the target system.
So is the a work-in-progress which aims at making makefiles of the archive compliant with Yocto?
If not, can someone help me to fix the compilation error reported just above?
Thanks
Vincent
Ps: sorry for the long post..
Yocto Recipe
Code: Select all
SUMMARY = "Recipe to add peaksystem CAN drivers to kernel"
LICENSE = "CLOSED"
inherit module
# The inherit of module.bbclass will automatically name module packages with
# "kernel-module-" prefix as required by the oe-core build environment.
KERNEL_MODULE_PACKAGE_SUFFIX = ""
SRC_URI = "https://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-8.5.1.tar.gz \
"
SRC_URI[md5sum] = "cfccfaff7f4f34a12fba6ec7989c9906"
SRC_URI[sha256sum] = "39a4ad75e890d8915999c9df2136a1b46649665b983e205dd0c67cd3b7d1387b"
S = "${WORKDIR}"
do_compile(){
#cd ${S}/${PN}-${PV}/driver
cd ${S}/peak-linux-driver-8.5.1/driver
oe_runmake
}
Code: Select all
DEBUG: Executing shell function do_compile
NOTE: make -j 4 KERNEL_SRC=/home/rd-otx/yocto/work/build/tmp/work-shared/genericx86-64/kernel-source
***
*** Host machine kernel version=4.13.0-38-generic
*** Driver kernel version=4.13.0-38-generic (4.13.0)
*** Path to kernel sources=/usr/src/linux-headers-4.13.0-38-generic
*** use KBUILD=yes
*** x86_64-poky-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/recipe-sysroot version=7.2.0
***
make -C /usr/src/linux-headers-4.13.0-38-generic SUBDIRS=/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver EXTRA_CFLAGS="-I/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver -DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DPCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT -Wno-date-time" V=0 modules
make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[1]: Entering directory '/usr/src/linux-headers-4.13.0-38-generic'
make[2]: Entering directory '/home/rd-otx/yocto/work/build/tmp/work-shared/genericx86-64/kernel-build-artifacts'
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_main.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_fops.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_fifo.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_filter.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_parse.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_sja1000.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_common.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_timing.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcanfd_core.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcanfd_ucan.o
CC [M] /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_pci.o
/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_pci.c: In function 'pcan_pci_enable_msi':
/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_pci.c:283:44: error: implicit declaration of function 'pci_enable_msi_range'; did you mean 'pci_enable_msix_range'? [-Werror=implicit-function-declaration]
#define pcan_pci_enable_msi_range(a, b, c) pci_enable_msi_range(a, b, c)
^
/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_pci.c:332:18: note: in expansion of macro 'pcan_pci_enable_msi_range'
pa->msi_count = pcan_pci_enable_msi_range(pa->dev, 1, can_count);
^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
/usr/src/linux-headers-4.13.0-38-generic/scripts/Makefile.build:308: recipe for target '/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_pci.o' failed
make[3]: *** [/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver/src/pcan_pci.o] Error 1
/usr/src/linux-headers-4.13.0-38-generic/Makefile:1550: recipe for target '_module_/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver' failed
make[2]: *** [_module_/home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/peak-linux-driver-8.5.1/driver] Error 2
make[2]: Leaving directory '/home/rd-otx/yocto/work/build/tmp/work-shared/genericx86-64/kernel-build-artifacts'
Makefile:145: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.13.0-38-generic'
Makefile:417: recipe for target 'all' failed
make: *** [all] Error 2
ERROR: oe_runmake failed
WARNING: /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/temp/run.do_compile.512:1 exit 1 from 'exit 1'
ERROR: Function failed: do_compile (log file is located at /home/rd-otx/yocto/work/build/tmp/work/genericx86_64-poky-linux/kernel-module-peaksystem/1.0-r0/temp/log.do_compile.512)