Openwrt 22.03 kernel module kmod-mac80211 build fails

I am trying to build a firmware for my x86 device with kmod-mt7915e kernel module. But with the latest openwrt 22.03 version the package package/kernel/mac80211 (kmod-mt7915e) fails to build.

make[2]: Entering directory '/home/shaheen/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/shaheen/openwrt/scripts/config'
time: target/linux/prereq#0.09#0.01#0.10
 make[1] world
 make[2] tools/compile
 make[2] package/cleanup
 make[3] -C tools/flock compile
 make[3] -C tools/xz compile
 make[3] -C tools/sed compile
 make[3] -C tools/tar compile
 make[3] -C tools/patch compile
 make[3] -C tools/m4 compile
 make[3] -C tools/autoconf-archive compile
 make[3] -C tools/ninja compile
 make[3] -C tools/cpio compile
 make[3] -C tools/lzma compile
 make[3] -C tools/mtools compile
 make[3] -C tools/patch-image compile
 make[3] -C tools/sstrip compile
 make[3] -C tools/xxd compile
 make[3] -C tools/zip compile
 make[3] -C tools/autoconf compile
 make[3] -C tools/missing-macros compile
 make[3] -C tools/meson compile
 make[3] -C tools/pkgconf compile
 make[3] -C tools/zstd compile
 make[3] -C tools/automake compile
 make[3] -C tools/libressl compile
 make[3] -C tools/dosfstools compile
 make[3] -C tools/libtool compile
 make[3] -C tools/cmake compile
 make[3] -C tools/flex compile
 make[3] -C tools/e2fsprogs compile
 make[3] -C tools/fakeroot compile
 make[3] -C tools/gengetopt compile
 make[3] -C tools/mklibs compile
 make[3] -C tools/gmp compile
 make[3] -C tools/patchelf compile
 make[3] -C tools/bison compile
 make[3] -C tools/mpfr compile
 make[3] -C tools/mpc compile
 make[3] -C tools/bc compile
 make[3] -C tools/findutils compile
 make[3] -C tools/mkimage compile
 make[3] -C tools/padjffs2 compile
 make[3] -C tools/quilt compile
 make[3] -C tools/zlib compile
 make[3] -C tools/expat compile
 make[3] -C tools/make-ext4fs compile
 make[3] -C tools/mtd-utils compile
 make[3] -C tools/firmware-utils compile
 make[3] -C tools/squashfskit4 compile
 make[2] toolchain/compile
 make[3] -C toolchain/gdb compile
 make[3] -C toolchain/binutils compile
 make[3] -C toolchain/fortify-headers compile
 make[3] -C toolchain/nasm compile
 make[3] -C toolchain/gcc/initial compile
 make[3] -C toolchain/kernel-headers compile
 make[3] -C toolchain/musl compile
 make[3] -C toolchain/gcc/final compile
 make[2] target/compile
 make[3] -C target/linux compile
 make[2] buildinfo
 make[2] package/compile
 make[3] diffconfig buildversion feedsversion
 make[3] -C package/libs/toolchain compile
 make[3] -C package/libs/libjson-c host-compile
 make[3] -C package/libs/ncurses host-compile
 make[3] -C package/system/fwtool host-compile
 make[3] -C package/kernel/gpio-button-hotplug compile
 make[3] -C package/system/usign host-compile
 make[3] -C package/boot/grub2 host-compile
 make[3] -C feeds/luci/modules/luci-base host-compile
 make[3] -C package/utils/lua host-compile
 make[3] -C feeds/luci/contrib/package/csstidy host-compile
 make[3] -C package/libs/libiconv host-compile
 make[3] -C feeds/packages/libs/libffi host-compile
 make[3] -C package/utils/bzip2 host-compile
 make[3] -C feeds/packages/utils/xz compile
 make[3] -C feeds/packages/libs/pcre2 compile
 make[3] -C package/firmware/wireless-regdb compile
 make[3] -C package/firmware/b43legacy-firmware compile
 make[3] -C package/network/services/dropbear compile
 make[3] -C package/network/utils/wireless-tools compile
 make[3] -C package/libs/libsepol compile
 make[4] scripts/config/conf
 make[3] -C package/utils/e2fsprogs host-compile
 make[3] -C package/libs/libubox host-compile
 make[3] -C package/libs/libnl-tiny compile
 make[3] -C package/libs/libjson-c compile
 make[3] -C package/utils/lua compile
 make[3] -C package/firmware/linux-firmware compile
 make[3] -C package/firmware/prism54-firmware compile
 make[3] -C package/libs/zlib compile
 make[3] -C package/system/fwtool compile
 make[3] -C package/system/ucert host-compile
 make[3] -C package/system/openwrt-keyring compile
 make[3] -C package/libs/libmnl compile
 make[3] -C package/libs/jansson compile
 make[3] -C package/libs/libiconv compile
 make[3] -C package/utils/bzip2 compile
 make[3] -C package/libs/argp-standalone compile
 make[3] -C package/libs/musl-fts compile
 make[3] -C feeds/luci/libs/luci-lib-ip compile
 make[3] -C feeds/luci/libs/luci-lib-jsonc compile
 make[3] -C feeds/luci/libs/luci-lib-nixio compile
 make[3] -C package/libs/mbedtls compile
 make[3] -C package/libs/libtool compile
 make[3] -C package/libs/libpcap compile
 make[3] -C package/network/utils/linux-atm compile
 make[3] -C package/network/utils/resolveip compile
 make[3] -C package/network/utils/wwan compile
 make[3] -C feeds/luci/protocols/luci-proto-ipv6 compile
 make[3] -C feeds/luci/protocols/luci-proto-ppp compile
 make[3] -C feeds/luci/themes/luci-theme-openwrt compile
 make[3] -C feeds/packages/libs/check compile
 make[3] -C feeds/packages/libs/c-ares compile
 make[3] -C feeds/packages/libs/cjson compile
 make[3] -C package/libs/openssl compile
 make[3] -C feeds/packages/libs/libuv compile
 make[3] -C package/libs/libcap compile
 make[3] -C package/libs/libnl compile
 make[3] -C feeds/packages/utils/attr compile
 make[3] -C package/libs/gmp compile
 make[3] -C package/system/ca-certificates compile
 make[3] -C feeds/packages/libs/nghttp2 compile
 make[3] -C feeds/packages/libs/libffi compile
 make[3] -C package/libs/pcre compile
 make[3] -C feeds/packages/utils/jq compile
 make[3] -C feeds/packages/libs/libdbi compile
 make[3] -C feeds/packages/libs/libev compile
 make[3] -C feeds/packages/libs/expat compile
 make[3] -C feeds/packages/libs/libical compile
 make[3] -C feeds/packages/libs/gdbm compile
 make[3] -C feeds/packages/lang/python/python-pip-conf compile
 make[3] -C feeds/packages/lang/python/python3 host-compile
 make[3] -C feeds/packages/libs/sqlite3 compile
 make[3] -C package/network/utils/iw compile
 make[3] -C package/libs/nettle compile
 make[3] -C package/network/utils/ethtool compile
 make[3] -C package/system/opkg host-compile
 make[3] -C package/libs/libubox compile
 make[3] -C package/kernel/linux compile
 make[3] -C package/libs/ncurses compile
 make[3] -C package/libs/libnftnl compile
 make[3] -C package/devel/binutils compile
 make[3] -C package/libs/elfutils compile
 make[3] -C package/libs/wolfssl compile
 make[3] -C /ns_source/netsurion/libnetsurion compile
 make[3] -C feeds/packages/utils/acl compile
 make[3] -C feeds/packages/utils/dbus compile
 make[3] -C package/kernel/button-hotplug compile
 make[3] -C package/network/ipv6/odhcp6c compile
 make[3] -C package/system/mtd compile
 make[3] -C package/system/urngd compile
 make[3] -C package/system/ubus compile
 make[3] -C package/system/uci compile
 make[3] -C package/utils/jsonfilter compile
 make[3] -C package/system/usign compile
 make[3] -C package/boot/grub2 compile
 make[3] -C package/network/utils/iptables compile
 make[3] -C package/network/utils/nftables compile
 make[3] -C package/utils/ucode compile
 make[3] -C package/network/utils/ipset compile
 make[3] -C feeds/luci/contrib/package/lucihttp compile
 make[3] -C package/network/utils/iwinfo compile
 make[3] -C feeds/packages/net/cgi-io compile
 make[3] -C package/libs/ustream-ssl compile
 make[3] -C package/network/utils/wireguard-tools compile
 make[3] -C package/network/services/ppp compile
 make[3] -C package/network/utils/uqmi compile
 make[3] -C feeds/packages/utils/coreutils compile
 make[3] -C feeds/packages/net/curl compile
 make[3] -C feeds/packages/libs/glib2 compile
 make[3] -C package/libs/readline compile
 make[3] -C package/libs/uclient compile
 make[3] -C package/network/services/dnsmasq compile
 make[3] -C package/network/services/odhcpd compile
 make[3] -C package/system/opkg compile
 make[3] -C package/libs/libselinux compile
 make[3] -C package/network/config/netifd compile
 make[3] -C package/system/ubox compile
 make[3] -C package/utils/util-linux compile
 make[3] -C package/network/config/firewall compile
 make[3] -C package/network/config/firewall4 compile
 make[3] -C feeds/luci/libs/luci-lib-base compile
 make[3] -C package/system/rpcd compile
 make[3] -C package/network/services/uhttpd compile
 make[3] -C feeds/luci/protocols/luci-proto-wireguard compile
 make[3] -C package/network/utils/comgt compile
 make[3] -C feeds/luci/protocols/luci-proto-qmi compile
 make[3] -C feeds/packages/libs/libwebsockets compile
 make[3] -C feeds/packages/utils/bluez compile
 make[3] -C package/network/services/hostapd compile
 make[3] -C package/system/urandom-seed compile
 make[3] -C package/utils/busybox compile
 make[3] -C package/network/services/hostapd compile
 make[3] -C feeds/luci/applications/luci-app-firewall compile
 make[3] -C package/network/utils/bpftools compile
 make[3] -C feeds/luci/libs/rpcd-mod-luci compile
 make[3] -C feeds/luci/applications/luci-app-wireguard compile
 make[3] -C feeds/luci/protocols/luci-proto-3g compile
 make[3] -C feeds/packages/net/mosquitto compile
 make[3] -C package/network/utils/iproute2 compile
 make[3] -C feeds/luci/modules/luci-base compile
 make[3] -C feeds/packages/net/mosquitto compile
 make[3] -C feeds/packages/net/mosquitto compile
 make[3] -C /ns_source/netsurion/ns_mgr compile
 make[3] -C package/boot/grub2 compile
 make[3] -C /ns_source/netsurion/ns_stats compile
 make[3] -C feeds/luci/modules/luci-compat compile
 make[3] -C feeds/luci/modules/luci-mod-network compile
 make[3] -C feeds/luci/modules/luci-mod-status compile
 make[3] -C feeds/luci/modules/luci-mod-system compile
 make[3] -C feeds/luci/applications/luci-app-uhttpd compile
 make[3] -C feeds/luci/modules/luci-mod-admin-full compile
 make[3] -C feeds/packages/net/mwan3 compile
 make[3] -C feeds/luci/applications/luci-app-mwan3 compile
 make[3] -C package/kernel/mac80211 compile
    ERROR: package/kernel/mac80211 failed to build (build variant: regular).
 make[3] -C package/boot/grub2 compile
 .config - OpenWrt Configuration
 > Search (7915e) > Wireless Drivers ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ┌───────────────────────────────────────────────────────────────────────────────────────── Wireless Drivers ─────────────────────────────────────────────────────────────────────────────────────────┐
  │  Arrow keys navigate the menu.  <Enter> selects submenus ---> (or empty submenus ----).  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, <M> modularizes features.  Press   │  
  │  <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend: [*] built-in  [ ] excluded  <M> module  < > module capable                                                                             │  
  │                                                                                                                                                                                                    │  
  │                                                                                                                                                                                                    │  
  │ ┌─────────────────────────────────────────────────────────────^(-)───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │  
  │ │                                                             < > kmod-libertas-sdio....................... Marvell 88W8686 Wireless Driver                                                      │ │  
  │ │                                                             < > kmod-libertas-spi.................... Marvell 88W8686 SPI Wireless Driver                                                      │ │  
  │ │                                                             < > kmod-libertas-usb........................ Marvell 88W8015 Wireless Driver                                                      │ │  
  │ │                                                             < > kmod-libipw............................... libipw for ipw2100 and ipw2200                                                      │ │  
  │ │                                                             -*- kmod-mac80211..................... Linux 802.11 Wireless Networking Stack  --->                                                │ │  
  │ │                                                             < > kmod-mac80211-hwsim........................ mac80211 HW simulation device                                                      │ │  
  │ │                                                             < > kmod-mt76........... MediaTek MT76x2/MT7603 wireless driver (metapackage)                                                      │ │  
  │ │                                                             < > kmod-mt7601u................... MT7601U-based USB dongles Wireless Driver                                                      │ │  
  │ │                                                             < > kmod-mt7603.............................. MediaTek MT7603 wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt7615-firmware........................... MediaTek MT7615e firmware                                                      │ │  
  │ │                                                             < > kmod-mt7615e............................ MediaTek MT7615e wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt7663-firmware-ap..... MediaTek MT7663e firmware (optimized for AP)                                                      │ │  
  │ │                                                             < > kmod-mt7663-firmware-sta. MediaTek MT7663e firmware (client mode offload)                                                      │ │  
  │ │                                                             < > kmod-mt7663s............................ MediaTek MT7663s wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt7663u............................ MediaTek MT7663u wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt76x0e............................ MediaTek MT76x0E wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt76x0u............................ MediaTek MT76x0U wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt76x2.............................. MediaTek MT76x2 wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt76x2u............................ MediaTek MT76x2U wireless driver                                                      │ │  
  │ │                                                             <*> kmod-mt7915e............................ MediaTek MT7915e wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt7921e............................ MediaTek MT7921e wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt7921s............................ MediaTek MT7921S wireless driver                                                      │ │  
  │ │                                                             < > kmod-mt7921u............................ MediaTek MT7921U wireless driver                                                      │ │  
  │ │                                                             < > kmod-mwifiex-pcie                                                                                                              │ │  
  │ │                                                             < > kmod-mwifiex-sdio                                                                                                              │ │  
  │ │                                                             < > kmod-mwl8k............... Driver for Marvell TOPDOG 802.11 Wireless cards                                                      │ │  
  │ │                                                             < > kmod-net-prism54................................ Intersil Prism54 support                                                      │ │  
  │ │                                                             < > kmod-net-rtl8192su........................... RTL8192SU support (staging)                                                      │ │  
  │ │                                                             < > kmod-owl-loader.... Owl loader for initializing Atheros PCI(e) Wifi chips                                                      │ │  
  │ │                                                             < > kmod-p54-common................................. Prism54 Drivers (COMMON)                                                      │ │  
  │ │                                                             < > kmod-p54-pci....................................... Prism54 Drivers (PCI)                                                      │ │  
  │ │                                                             < > kmod-p54-usb....................................... Prism54 Drivers (USB)                                                      │ │  
  │ │                                                             < > kmod-rsi91x.................. Redpine Signals Inc 91x WLAN driver support                                                      │ │  
  │ │                                                             < > kmod-rsi91x-sdio........................ Redpine Signals SDIO bus support                                                      │ │  
  │ │                                                             < > kmod-rsi91x-usb.......................... Redpine Signals USB bus support                                                      │ │  
  │ │                                                             < > kmod-rt2400-pci............. Ralink Drivers for RT2x00 cards (RT2400 PCI)                                                      │ │  
  │ │                                                             < > kmod-rt2500-pci............. Ralink Drivers for RT2x00 cards (RT2500 PCI)                                                      │ │  
  │ │                                                             < > kmod-rt2500-usb............. Ralink Drivers for RT2x00 cards (RT2500 USB)                                                      │ │  
  │ │                                                             < > kmod-rt2800-pci............. Ralink Drivers for RT2x00 cards (RT2860 PCI)                                                      │ │  
  │ └─────────────────────────────────────────────────────────────v(+)───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ │  
  ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤  
  │                                                                      <Select>    < Exit >    < Help >    < Save >    < Load >                                                                      │  
  └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘  

Can someone suggest a solution for this ?

Looks like a local issue to me, since it's been building fine over here. None of what you share is useful for debugging unfortunately - all you need is the output of a make -j1 V=sc then check the output relevant to the mac80211 package.

You can reproduce this issue by enabling kmod-mt7915e package . And same goes for hostapd package as well. If I disable these packages I can build an image.

I'm running builds for a device with MT7915E myself. Please read what I wrote and act on it.

1 Like

This is the relevant part of the compilation error.

make[4]: Entering directory '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1'
make[5]: 'Kconfig.versions' is up to date.
make[7]: 'Kconfig.versions' is up to date.
make[8]: 'conf' is up to date.
boolean symbol CRYPTO_LIB_ARC4 tested for 'm'? test forced to 'n'
#
# configuration written to .config
#
Building backport-include/backport/autoconf.h ... done.
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
echo >&2;							\
echo >&2 "  ERROR: Kernel configuration is invalid.";		\
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
echo >&2 ;							\
/bin/false)
/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/scripts/make -f ./scripts/Makefile.build obj=/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1 \
single-build= \
need-builtin=1 need-modorder=1
/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/scripts/make -f ./scripts/Makefile.build obj=/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/compat \
 \
need-builtin=1 \
need-modorder=1
make[9]: *** No rule to make target '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/compat/main.o', needed by '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/compat/compat.o'.  Stop.
make[8]: *** [scripts/Makefile.build:497: /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/compat] Error 2
make[7]: *** [Makefile:1822: /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1] Error 2
make[6]: *** [Makefile.build:13: modules] Error 2
make[5]: *** [Makefile.real:93: modules] Error 2
make[4]: *** [Makefile:121: modules] Error 2
make[4]: Leaving directory '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1'
make[3]: *** [Makefile:559: /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/.built] Error 2
make[3]: Leaving directory '/home/shaheen/openwrt/package/kernel/mac80211'
time: package/kernel/mac80211/regular/compile#0.85#0.32#1.13
    ERROR: package/kernel/mac80211 failed to build (build variant: regular).
make[2]: *** [package/Makefile:116: package/kernel/mac80211/compile] Error 1
make[2]: Leaving directory '/home/shaheen/openwrt'
make[1]: *** [package/Makefile:110: /home/shaheen/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/shaheen/openwrt'
make: *** [/home/shaheen/openwrt/include/toplevel.mk:230: world] Error 2

Looks like this is your error:

make[9]: *** No rule to make target '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/compat/main.o', needed by '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/compat/compat.o'.  Stop.

Try running a make clean on the mac80211 package, then recompile it (again single package) with make -j1 V=sc.

Cleaning single package did not fix this issue.

cc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DKBUILD_NO_NLS   -c -o conf.o conf.c
lex -ozconf.lex.c -L zconf.l
yacc -ozconf.tab.c -t -l zconf.y
cc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DKBUILD_NO_NLS   -c -o zconf.tab.o zconf.tab.c
cc   conf.o zconf.tab.o   -o conf
boolean symbol CRYPTO_LIB_ARC4 tested for 'm'? test forced to 'n'
#
# configuration written to .config
#
make[4]: Leaving directory '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1'
rm -rf /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/modules
make  -C "/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1" KCFLAGS="-fmacro-prefix-map=/home/shaheen/openwrt/build_dir/target-x86_64_musl=target-x86_64_musl" HOSTCFLAGS="-O2 -I/home/shaheen/openwrt/staging_dir/host/include -I/home/shaheen/openwrt/staging_dir/hostpkg/include -I/home/shaheen/openwrt/staging_dir/target-x86_64_musl/host/include -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="x86_64-openwrt-linux-musl-" ARCH="x86" KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST="" KBUILD_BUILD_TIMESTAMP="Sun Mar 27 15:14:00 2022" KBUILD_BUILD_VERSION="0" HOST_LOADLIBES="-L/home/shaheen/openwrt/staging_dir/host/lib" KBUILD_HOSTLDLIBS="-L/home/shaheen/openwrt/staging_dir/host/lib" CONFIG_SHELL="bash" V=1  cmd_syscalls= KBUILD_EXTRA_SYMBOLS="/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/symvers/button-hotplug.symvers" KERNELRELEASE=5.10.108 EXTRA_CFLAGS="-I/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/include -fmacro-prefix-map=/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1=backports-5.15.8-1 " KLIB_BUILD="/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.108" MODPROBE=true KLIB=/lib/modules/5.10.108 KERNEL_SUBLEVEL=10 KBUILD_LDFLAGS_MODULE_PREREQ= modules
make[4]: Entering directory '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1'
make[5]: 'Kconfig.versions' is up to date.
make[7]: 'Kconfig.versions' is up to date.
make[8]: 'conf' is up to date.
boolean symbol CRYPTO_LIB_ARC4 tested for 'm'? test forced to 'n'
#
# configuration written to .config
#
Building backport-include/backport/autoconf.h ... done.
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
echo >&2;							\
echo >&2 "  ERROR: Kernel configuration is invalid.";		\
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
echo >&2 ;							\
/bin/false)
/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/scripts/make -f ./scripts/Makefile.build obj=/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1 \
single-build= \
need-builtin=1 need-modorder=1
/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/scripts/make -f ./scripts/Makefile.build obj=/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1/compat \
 \
need-builtin=1 \
need-modorder=1
make[4]: Leaving directory '/home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/backports-5.15.8-1'
make[3]: Leaving directory '/home/shaheen/openwrt/package/kernel/mac80211'
time: package/kernel/mac80211/regular/compile#3.43#0.74#3.96
    ERROR: package/kernel/mac80211 failed to build (build variant: regular).
make[2]: Leaving directory '/home/shaheen/openwrt'
make[1]: Leaving directory '/home/shaheen/openwrt'

I am not able to find a solution yet.

Try compiling for the EAP615-Wall (mt7621 target with mt7915 radio) and see if that goes well. It almost looks like mac80211 doesn't compile fully well for the x86/64 target. At least that way you'll have a reference to open a bug report.

I have compiled for EAP615-Wall without any error. The issue happens only for the x86 target.

Better file an issue then.

@Borromini I filed an issue. It seems like no one is responding. Following is the link to that. It seems I'm stuck with this issue.

Do you have any idea what I should do next?

Did you ever find a solution to this? I have a very similar issue, but with a different kernel module. It compiles fine with a bare config, but after I select packages in menuconfig it fails to build button-hotplug. It looks like a build byproduct isn't being cleaned up, so it doesn't re-make the generated makefile that includes the definition for button-hotplug.o.

Yes. I have found out a solution.

  1. Do make distclean
  2. Then select the target and only kmod-mt7915e.
  3. After successful compilation select all other packages. Then compile again. This is only a temporary fix.