I use imx8mp system here
Create a recipe to rtl8852be-wifi-linux_01.bb
The program code that needs to be compiled uses the local compressed package path as follows:
file/rtl8852be-wifi-linux.tar.bz2
When compiling, an error will occur in do_configure or do_compile as shown below
NOTE: Executing Tasks
ERROR: rtl8852be-wifi-linux-01-r0 do_configure: oe_runmake failed
ERROR: rtl8852be-wifi-linux-01-r0 do_configure: ExecutionError('/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_configure.1129032', 1, None, None)
ERROR: Logfile of failure stored in: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/log.do_configure.1129032
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/meta-imx/meta-bsp/recipes-kernel/linux/linux-imx_5.15.bb:do_populate_sysroot', '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-core/glibc/glibc_2.35.bb:do_populate_sysroot', '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/binutils/binutils-cross_2.38.bb:do_populate_sysroot', '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/gcc/gcc-cross_11.3.bb:do_populate_sysroot', '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_11.3.bb:do_populate_sysroot', '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.67.bb:do_populate_sysroot', '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-connectivity/openssl/openssl_3.0.5.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/bison/bison_3.8.2.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/flex/flex_2.6.4.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/make/make_4.3.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-kernel/dtc/dtc_1.6.1.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-kernel/kmod/kmod_29.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-support/gmp/gmp_6.2.1.bb:do_populate_sysroot', 'virtual:native:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/poky/meta/recipes-support/lzop/lzop_1.04.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['linux-imx', 'glibc', 'binutils-cross-aarch64', 'gcc-cross-aarch64', 'gcc-runtime', 'quilt-native', 'kern-tools-native', 'openssl-native', 'bison-native', 'flex-native', 'make-native', 'patch-native', 'pkgconfig-native', 'pseudo-native', 'bc-native', 'dtc-native', 'kmod-native', 'gmp-native', 'lzop-native', 'libtool-native', 'texinfo-dummy-native', 'mpfr-native', 'zlib-native', 'gnu-config-native', 'linux-libc-headers', 'libmpc-native', 'xz-native', 'zstd-native', 'gettext-minimal-native', 'python3-native', 'm4-native', 'readline-native', 'attr-native', 'libgcc', 'perl-native', 'lzo-native', 'ncurses-native', 'libffi-native', 'gdbm-native', 'libtirpc-native', 'util-linux-libuuid-native', 'bzip2-native', 'libnsl2-native', 'sqlite3-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_configure
| NOTE: make KERNEL_src=/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source -C Ksrc=/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source M=/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux clean
| make: *** Ksrc=/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source: No such file or directory. Stop.
| ERROR: oe_runmake failed
| WARNING: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_configure.1129032:193 exit 1 from 'exit 1'
| WARNING: Backtrace (BB generated script):
| #1: bbfatal_log, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_configure.1129032, line 193
| #2: die, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_configure.1129032, line 177
| #3: oe_runmake, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_configure.1129032, line 172
| #4: base_do_configure, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_configure.1129032, line 157
| #5: do_configure, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_configure.1129032, line 148
| #6: main, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_configure.1129032, line 206
ERROR: Task (/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/meta-smarc/recipes-smarc/rtl8852be-wifi-linux/rtl8852be-wifi-linux_01.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 855 tasks of which 853 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/meta-smarc/recipes-smarc/rtl8852be-wifi-linux/rtl8852be-wifi-linux_01.bb:do_configure
Summary: There was 1 WARNING message.
Summary: There were 2 ERROR messages, returning a non-zero exit code.
martin@aaa-System-Product-Name:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland$
The contents of my recipe file are as follows
rtl8852be-wifi-linux_01.bb
DESCRIPTION = "rtl8852BE WiFi kernel module out of the kernel tree"
SECTION = "rtl8852be-wifi-linux"
LICENSE = "CLOSED"
AUTHOR = "martinliang@linkence.com"
DEPENDS += "linux-imx make-native dtc-native"
inherit module
SRC_URI = "file://rtl8852be-wifi-linux.tar.bz2"
python do_display_banner() {
bb.plain("***********************************************");
bb.plain("* build rtl8852be WiFi linux recipe *");
bb.plain("***********************************************");
}
addtask display_banner before do_build
RPROVIDES_${PN} += "rtl8852be-wifi-linux"
S = "${WORKDIR}/${BPN}"
EXTRA_OEMAKE += "-C Ksrc=${STAGING_KERNEL_DIR} M=${S}"
do_compile() {
echo =====
echo rtl8852be wifi linux do_compile
echo TARGET_PREFIX = ${TARGET_PREFIX}
echo ARCH=${ARCH}
echo KERNEL_PATH=${STAGING_KERNEL_DIR}
echo KDIR=${STAGING_KERNEL_BUILDDIR}
echo S = ${S}
echo =====
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
oe_runmake
}
do_install() {
echo =====
echo rtl8852be wifi linux do_install
echo =====
install -d -d ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}
install -m 0644 ${B}/8852be.ko ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/8852be.ko
}
Why can't the system find the kernel code location?
How to correctly specify the kernel code for makefile compilation?
There are some non-compliant uses in your recipes
Like the line EXTRA_OEMAKE += "-C Ksrc=${STAGING_KERNEL_DIR} M=${S}"
May have a reference to recipes under sources/meta-imx/meta-imx-v2x/recipes-kernel and
sources/meta-imx/meta-imx-bsp/recipes-kernel/kernel-modules
Regards
Harvey
I noticed this problem yesterday
After modification, you can find the kernel source
EXTRA_OEMAKE += "Ksrc=${STAGING_KERNEL_DIR} "
EXTRA_OEMAKE += "M=${S} "
Remove "-C"
But GCC compilation problems occur again
| NOTE: make -j 24 KERNEL_src=/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source Ksrc=/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source M=/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux
| #rm -f .symvers.8852be
| make ARCH=arm64 CROSS_COMPILE= -C /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source M=/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux modules
| make[1]: Entering directory '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source'
| make[2]: Entering directory '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-build-artifacts'
| warning: the compiler differs from the one used to build the kernel
| The kernel was built by: aarch64-poky-linux-gcc (GCC) 11.3.0
| You are using: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
| CC [M] /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/platform/platform_linux_pc_pci.o
| gcc: error: unrecognized argument in option '-mstack-protector-guard=sysreg'
| gcc: note: valid arguments to '-mstack-protector-guard=' are: global tls
| CC [M] /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/os_dep/osdep_service.o
| gcc: error: unrecognized argument in option '-mstack-protector-guard=sysreg'
| gcc: note: valid arguments to '-mstack-protector-guard=' are: global tls
| gcc: error: unrecognized command line option '-mlittle-endian'
| CC [M] /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/os_dep/osdep_service_linux.o
| gcc: error: unrecognized argument in option '-mstack-protector-guard=sysreg'
| gcc: note: valid arguments to '-mstack-protector-guard=' are: global tls
| CC [M] /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/os_dep/linux/rtw_cfg.o
| gcc: error: unrecognized command line option '-mlittle-endian'
| gcc: error: unrecognized argument in option '-mstack-protector-guard=sysreg'
| gcc: note: valid arguments to '-mstack-protector-guard=' are: global tls
| gcc: error: unrecognized command line option '-mlittle-endian'
| CC [M] /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/os_dep/linux/os_intfs.o
| gcc: error: unrecognized command line option '-mbranch-protection=pac-ret+leaf'
| gcc: error: unrecognized argument in option '-mstack-protector-guard=sysreg'
| gcc: note: valid arguments to '-mstack-protector-guard=' are: global tls
| make[3]: *** [/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source/scripts/Makefile.build:289: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/platform/platform_linux_pc_pci.o] Error 1
| make[3]: *** Waiting for unfinished jobs....
| gcc: error: unrecognized command line option '-mlittle-endian'
| gcc: error: unrecognized command line option '-mbranch-protection=pac-ret+leaf'
| make[3]: *** [/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source/scripts/Makefile.build:289: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/os_dep/osdep_service.o] Error 1
| gcc: error: unrecognized command line option '-mlittle-endian'
| gcc: error: unrecognized command line option '-mbranch-protection=pac-ret+leaf'
| make[3]: *** [/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source/scripts/Makefile.build:289: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/os_dep/osdep_service_linux.o] Error 1
| gcc: error: unrecognized command line option '-mbranch-protection=pac-ret+leaf'
| make[3]: *** [/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source/scripts/Makefile.build:289: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/os_dep/linux/rtw_cfg.o] Error 1
| gcc: error: unrecognized command line option '-mbranch-protection=pac-ret+leaf'
| make[3]: *** [/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source/scripts/Makefile.build:289: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux/os_dep/linux/os_intfs.o] Error 1
| make[2]: *** [/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source/Makefile:1898: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/rtl8852be-wifi-linux] Error 2
| make[2]: Leaving directory '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-build-artifacts'
| make[1]: *** [Makefile:219: __sub-make] Error 2
| make[1]: Leaving directory '/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work-shared/imx8mpevk/kernel-source'
| make: *** [Makefile:664: modules] Error 2
| ERROR: oe_runmake failed
| WARNING: /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_compile.2087935:192 exit 1 from 'exit 1'
| WARNING: Backtrace (BB generated script):
| #1: bbfatal_log, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_compile.2087935, line 192
| #2: die, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_compile.2087935, line 176
| #3: oe_runmake, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_compile.2087935, line 171
| #4: do_compile, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_compile.2087935, line 160
| #5: main, /media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland/tmp/work/imx8mpevk-poky-linux/rtl8852be-wifi-linux/01-r0/temp/run.do_compile.2087935, line 205
ERROR: Task (/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/meta-smarc/recipes-smarc/rtl8852be-wifi-linux/rtl8852be-wifi-linux_01.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 843 tasks of which 827 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/sources/meta-smarc/recipes-smarc/rtl8852be-wifi-linux/rtl8852be-wifi-linux_01.bb:do_compile
Summary: There was 1 WARNING message.
Summary: There were 2 ERROR messages, returning a non-zero exit code.
martin@aaa-System-Product-Name:/media/8TB/imx8mp-yocto/martin/imx-5.15.71-2.2.0/build-xwayland$