Drivers error trying to compile kernel

Hello,

I have tried compile kernel several times, using https://wiki.radxa.com/Rockpi4/dev/kernel-4.4 and https://wiki.radxa.com/Rockpi4/dev/Debian instructions on ubuntu server x86-64, i get the same error in drivers section:

CC [M] drivers/headset_observe/rockchip_headset_core.o
CC kernel/module.o
CC [M] drivers/headset_observe/rk_headset.o
drivers/headset_observe/rockchip_headset_core.c:205:20: warning: ‘rockchip_headset_exit’ defined but not used [-Wunused -function]
error, forbidden warning:rockchip_headset_core.c:205
static void __exit rockchip_headset_exit(void)
^~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:283: recipe for target ‘drivers/headset_observe/rockchip_headset_core.o’ failed
make[4]: *** [drivers/headset_observe/rockchip_headset_core.o] Error 1
make[4]: *** Waiting for unfinished jobs…
CC drivers/hid/hid-core.o
CC drivers/hid/hid-input.o
CC drivers/hid/hid-debug.o
LD drivers/hsi/clients/built-in.o
LD drivers/hsi/controllers/built-in.o
LD drivers/hsi/built-in.o
CC drivers/hwmon/hwmon.o
scripts/Makefile.build:484: recipe for target ‘drivers/headset_observe’ failed
make[3]: *** [drivers/headset_observe] Error 2
make[3]: *** Waiting for unfinished jobs…

LD drivers/hid/built-in.o
Makefile:1031: recipe for target ‘drivers’ failed
make[2]: *** [drivers] Error 2
scripts/package/Makefile:96: recipe for target ‘bindeb-pkg’ failed
make[1]: *** [bindeb-pkg] Error 2
Makefile:1319: recipe for target ‘bindeb-pkg’ failed
make: *** [bindeb-pkg] Error 2

using “mk-kernel.sh rockpi4b” on rockchip-bsp.git

LD drivers/gpu/drm/built-in.o
LD drivers/gpu/built-in.o
Makefile:1031: recipe for target ‘drivers’ failed
make: *** [drivers] Error 2
MAKE KERNEL IMAGE FAILED.

It seems a compiler issue, are you using the gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- toolchain?

This


goes in 1st try :slight_smile:

scripts/Makefile.build:484: recipe for target ‘drivers/headset_observe’ failed
make[1]: *** [drivers/headset_observe] Error 2
make[1]: *** Waiting for unfinished jobs…
Makefile:1031: recipe for target ‘drivers’ failed
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs…
root@ubuntueck:/home/domven/kernel-release-4.4-rockpi4# which aarch64-linux-gnu-gcc
/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc

The issue is in your config file. I have faced the same issue before and and appears to be due to a missing CONFIG option in the .config file generated through make menuconfig.

You need to add these two CONFIG options in your .config file:

CONFIG_EXTRA_FIRMWARE_DIR="lib/firmware"
CONFIG_EXTRA_FIRMWARE="<name_of_firmware_along_with_path>"

In some platforms, the GPU uses firmware that needs to be built-in by stitching it with kernel. This firmware is placed in the directory path provided by CONFIG_EXTRA_FIRMWARE option while building the kernel. And unless we don’t provide CONFIG_EXTRA_FIRMWARE_DIR path to tell the kernel where to pick this firmware from, the above build failure occurs.