I can't compile the kernel for Rock Pi 4B on my debian/testing host

Hi,

I need to connect the TC358743-based HDMI to CSI adapter to the Rock Pi 4B board. Unfortunately, that driver is not available in the debian distribution for Rock Pi 4B. Therefore, I need to compile it (or compile the kernel with that driver enabled) myself.
I have followed the procedure described in https://wiki.radxa.com/Rockpi4/dev/Debian#Build_kernel
However, after doing (with selecting the TC358743 driver in menuconfig):

   cd kernel
   export ARCH=arm64
   export CROSS_COMPILE=aarch64-linux-gnu-
   make rockchip_linux_defconfig
   make menuconfig
   cd ..
   ./build/mk-kernel.sh rockpi4b 

I get the following error:

fs/exec.c: In function ‘get_task_comm’:
fs/exec.c:1084:32: warning: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
error, forbidden warning:exec.c:1084
 1084 |  strncpy(buf, tsk->comm, sizeof(tsk->comm));
      |                                ^
make[1]: *** [scripts/Makefile.build:277: fs/exec.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC      security/keys/keyring.o
  CC      arch/arm64/kernel/vdso.o
  CC      kernel/capability.o
  CC      security/keys/keyctl.o
arch/arm64/kernel/vdso.c: In function ‘vdso_init’:
arch/arm64/kernel/vdso.c:119:6: warning: ‘memcmp’ reading 4 bytes from a region of size 1 [-Wstringop-overflow=]
error, forbidden warning:vdso.c:119
  119 |  if (memcmp(&vdso_start, "\177ELF", 4)) {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:278: arch/arm64/kernel/vdso.o] Error 1
make: *** [Makefile:1031: arch/arm64/kernel] Error 2
make: *** Waiting for unfinished jobs....
  CC      security/apparmor/ipc.o
  CC      security/keys/permission.o

The compiler installed in my system is:

${CROSS_COMPILE}gcc --version 
aarch64-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909

Is it possible that this compiler is too new to compile the old 4.4 kernel?
How can I cure it in the easiest way?

TIA & BR,
Wojtek

It is normal. We use 15 different to cope with this diversity.

Start here https://github.com/armbian/build and it will be easy.

Thanks, I’ll try it. Maybe it will also solve my problem with building the Linux image for Rock Pi 4B with Buildroot. I have invested some time to create the Buildroot configuration that builds working Linux image with kernel 5.2, and then I’ve found that the device tree in the mainline kernel does not contain any nodes related to the CSI video input…
I tried to lower the kernel version to 4.4 and use the version from Rock Pi BSP, and then I had the same issue with too new compiler.
However, the old compiler is not able to compile a few applications in the newest Buildroot. So probably for Buildroot I’ll have to use a hybrid approach with kernel compiled independently from rootfs…

Thanks & regards,
Wojtek

Mainline kernel still needs some work here and there for RK3399 … don’t know about CSI - not my field of interest.

I was compiling those sources with 7.2 from Linaro and 8.3 from ARM. Not exactly those, since we use slightly changed branch. Not sure if that plays any role in this.

No troubles with Armbian :slight_smile: Precompiled packages are taken from Debian/Ubuntu repository while stuff that needs to be compiled (preloaders, ATF, u-boot, kernel, …) have defined exact compiler variant and version.

OK. In case of Buidroot 2019.08.1, it appeared that selection of the older toolchain - “Linaro AArch64 2018.05” allows me to compile the kernel and all needed applications.
Thanks,
Wojtek

The wiki is updated to use the Linaro toolchain.

https://wiki.radxa.com/Rockpi4/dev/Debian