Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5923

Raspberry Pi OS • Re: kernel ompile error

$
0
0
I want to compile the kernel on a pi4 host(target is pi3B), follow the document https://www.raspberrypi.com/documentati ... ernel.html, I run the commands:

Code:

KERNEL=kernel8make bcm2711_defconfig
bcm2711_defconfig is for a Pi 4 but your target is a Pi 3?
The host is a pi4, hostnamectl output:

Code:

   Static hostname: rpi-bullseye-armhf         Icon name: computer        Machine ID: 008cf0926c7c4fa6b0e80298c964fe39           Boot ID: b22ef6ae569441f59b046bf0547221f0  Operating System: Raspbian GNU/Linux 11 (bullseye)            Kernel: Linux 6.1.21-v8+      Architecture: arm64
Your Pi 4 is running Raspberry Pi OS 32-bit (armhf) but with the 64-bit kernel which is why it shows arm64 for the architecture. This means all the utilities like the compiler are the armhf 32-bit versions. The armhf compiler isn't able to generate arm64 code.

The easiest option is to use Raspberry Pi OS 64-bit but it'll need a spare SD/USB. Otherwise you'll need to install a arm64 cross-compiler and use that to compile the kernel.

Statistics: Posted by trejan — Sat Apr 13, 2024 1:57 am



Viewing all articles
Browse latest Browse all 5923

Trending Articles