Problem with compiling ayufans linux kernel
#1
Hi all

I tried to compile the ayufans kernel for the rockpro64 directly on the rockpro64 itself and on my x86 workstation. But in both cases I get a similar error:
Code:
In function 'hid_report_readreg.constprop',
   inlined from 'rkvr_dev_attr_debug_show' at drivers/hid/hid-rkvr.c:826:7:
drivers/hid/hid-rkvr.c:780:3: warning: 'memcpy' forming offset 2 is out of the bounds [0, 1] of object 'mpu6500_id' with type 'u8' {aka 'unsigned char'} [-Warray-bounds]
error, forbidden warning:hid-rkvr.c:780
  memcpy(data, &buf[1], readlen);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-rkvr.c: In function 'rkvr_dev_attr_debug_show':
drivers/hid/hid-rkvr.c:822:5: note: 'mpu6500_id' declared here
 u8 mpu6500_id = 0;
    ^~~~~~~~~~
make[2]: *** [scripts/Makefile.build:277: drivers/hid/hid-rkvr.o] Error 1
make[1]: *** [scripts/Makefile.build:484: drivers/hid] Error 2
make[1]: *** Waiting for unfinished jobs...

I got the source code from here https://github.com/ayufan-rock64/linux-kernel and I used the branch release-4.4.190 which corresponds with the kernel running on my rockpro64. I used the config from arch/arm64/configs/rockchip_linux_defconfig.


I installed some packages on my workstation for cross compiling and tried to build the kernel with the following command, but I get the error from above.
Code:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j24 Image


I'm able to successfully build the current mainline kernel with this command, but I haven't tried to boot from it. Because I could't cross compile the kernel from ayufan, I tried to compile it on my rockpro64, which is running the buster-minimal Image from ayufan. I installed the following packages on it.
Code:
build-essential libncurses-dev bison flex libssl-dev fakeroot pkg-config python


And used this command to compile it, but I get a similar error message as above.
Code:
make -j6 Image


If anybody has an idea what is wrong with my setup or knows a guide on how to compile this kernel, I would be glad about an answer.

Thanks in advance
#2
?
make menuconfig
?
My notes how I got a compile to work are here, but it was a long time ago.
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (5.14 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone BraveHeart now v1.2b 3/32Gb daily driver, dual boot via p-boot with Mobian/f2fs/Phosh on eMMC, Arch/ext4/Phosh on SDcard
  • PinePhone v1.2a 2G/16Gb that needs USB board replaced
#3
Try:

Code:
KCFLAGS="-Wno-array-bounds -Wno-stringop-overflow" make Image dtbs
#4
(12-31-2019, 07:04 PM)dukla2000 Wrote: ?
make menuconfig
?
My notes how I got a compile to work are here, but it was a long time ago.

Thanks for your reply! I used make menuconfig, forgot to write this in my post.
Btw. thanks for your notes, I used them in the first place, trying to compile the kernel on the rockpro. I rechecked them and the only difference is the repository from ayufan.

In your notes is this repo: https://github.com/ayufan-rock64/linux-mainline-kernel
And I used this (which corresponds to the kernel used in the buster image) https://github.com/ayufan-rock64/linux-kernel

I don' t really know what's the difference between those, but I can successfully build the repo in your notes.

(01-04-2020, 01:57 PM)patstew Wrote: Try:

Code:
KCFLAGS="-Wno-array-bounds -Wno-stringop-overflow" make Image dtbs

Thanks for your reply! I can build the kernel with these options. I guess it just disables the compiler errors for overflows? Is it normal that the kernel for aarch64 needs to be compiled with these options or am I doing something wrong?
#5
(01-06-2020, 09:52 AM)voegelit Wrote: Thanks for your reply! I can build the kernel with these options. I guess it just disables the compiler errors for overflows? Is it normal that the kernel for aarch64 needs to be compiled with these options or am I doing something wrong?

They're new warnings that weren't checked in older versions of the compiler. They may indicate bugs in the kernel, but if so they're not new bugs.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Manjaro ARM - Built-in ethernet was broken with kernel 5.14.1-1 (over now) Dendrocalamus64 2 390 09-11-2021, 08:58 PM
Last Post: t4_4t
  Compiling ayufan mainline - DT-overlay missing Mentaluproar 0 392 07-24-2021, 09:46 PM
Last Post: Mentaluproar
  compiling a new kernel for overclocking on arch Mentaluproar 2 689 07-15-2021, 10:16 AM
Last Post: Mentaluproar
  Other boot options than Sdcard for linux 5.x kernel? MisterA 2 710 07-14-2021, 02:37 PM
Last Post: TRS-80
Brick Maintained Linux booting from eMMC ootoovak 5 1,172 07-06-2021, 02:28 PM
Last Post: TRS-80
  ayufan kernel update unbootable TheHunter 2 1,084 03-12-2021, 05:17 PM
Last Post: LMM
  Booting Linux/Debian from the eMMC linuxha 4 1,524 03-02-2021, 07:01 PM
Last Post: linuxha
  Kernel oops after big-ish writes gaeb 1 881 02-11-2021, 03:55 PM
Last Post: gaeb
  Kernel Update from 4.4 (Ayufan) on Ubuntu 20.04 db579 3 2,468 10-22-2020, 01:12 PM
Last Post: dukla2000
  Xen EFI with Alpine Linux dom0 sir.lami 0 1,258 08-26-2020, 12:25 PM
Last Post: sir.lami

Forum Jump:


Users browsing this thread: 1 Guest(s)