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

C/C++ • Re: CMake and arch-specific compiler options

$
0
0
which gives me the following error:

Code:

E:  Unable to execute target architecture
Looking at the debootstrap log, it just says:

Code:

armhf: not supported on this machine/kernel
Looks like this has to do with a peculiarity of the RPi 5 that I was not aware of: Raspberry Pi OS bookworm on the Pi 5 uses a different kernel than all the other Pis (kernel_2712 instead of kernel8), and this kernel indeed does not support 32-bit programs. https://www.raspberrypi.com/documentati ... figuration

It seems like many development tools such as mk-sbuild, qemu-user-static, etc. tacitly assume that AArch64 systems are able to execute 32-bit ARM user-space programs as well. Since this is not the case when you're using 64-bit Raspberry Pi OS on the Pi 5 with their custom kernel, these tools fail, as you've noticed.

You could select "kernel8" to get around this issue (https://www.raspberrypi.com/documentati ... tml#kernel), but for a proper fix, actual changes need to be applied to these development packages to get rid of the implicit assumptions.

Note that this problem only affects the installation of 32-bit Raspberry Pi OS in a chroot on a 64-bit Pi 5.
If you get your sysroot from elsewhere (e.g. extracting one of the downloads from the RPi website or copying it from another system), you can still cross-compile as usual. (But you cannot run the cross-compiled program on the Pi 5, and managing dependencies becomes harder.)

Either way, I stand by my advice in your other thread: if you're going to do cross-compilation, do it on an x86-64 system, where you're way less likely to run into issues like this, because it's the standard system that most developers are currently using.

Statistics: Posted by tttapa — Fri Aug 30, 2024 11:39 pm



Viewing all articles
Browse latest Browse all 5381

Trending Articles