Skip to content

Commit c037878

Browse files
committed
docs(arm64-compat-vdso): document why COMPAT helps cross-arch armhf builds
Spell out the practical effect of CONFIG_COMPAT + COMPAT_VDSO + ARM64_32BIT_EL0: an arm64 host running such a kernel can execute armhf userspace natively, so rootfs/chroot steps run native instead of via qemu-user-static (~10× faster). Cross-reference the rootfs probe and the ARMBIAN_PREFER_NATIVE_ARMHF switch, and note the Apple-M-series exception (no AArch32@EL0 in silicon). Assisted-by: Claude:claude-opus-4.7
1 parent 6654264 commit c037878

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

extensions/arm64-compat-vdso.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# Enable 32-bit compat vDSO for arm64 kernels with GCC or clang.
2+
#
3+
# Builds the kernel with CONFIG_COMPAT + COMPAT_VDSO + ARM64_32BIT_EL0, letting
4+
# an arm64 host running this kernel execute armhf (32-bit ARM) userspace
5+
# natively at full speed. One concrete use case is Armbian's rootfs phase: on
6+
# such a host, armhf chroot / package post-install steps run native instead of
7+
# through qemu-user-static (~10× faster). See lib/functions/rootfs/qemu-static.sh
8+
# and the PREFER_NATIVE_ARMHF build switch.
9+
#
10+
# Note: aarch64 silicon without 32-bit ARM userspace support at EL0 (notably
11+
# Apple M-series) cannot run armhf even with this kernel option enabled.
12+
#
213
# Requirements:
314
# - arm64 build target (ARCH=arm64, ARCHITECTURE=arm64).
415
# - For GCC builds: a 32-bit ARM cross-compiler (default prefix arm-linux-gnueabi-),
@@ -25,7 +36,7 @@ function host_dependencies_ready__arm64_compat_vdso() {
2536
fi
2637

2738
local compat_gcc_prefix="${CROSS_COMPILE_COMPAT:-"arm-linux-gnueabi-"}"
28-
if ! command -v "${compat_gcc_prefix}gcc" >/dev/null 2>&1; then
39+
if ! command -v "${compat_gcc_prefix}gcc" > /dev/null 2>&1; then
2940
exit_with_error "Missing 32-bit compiler '${compat_gcc_prefix}gcc' for COMPAT_VDSO; install gcc-arm-linux-gnueabi or set CROSS_COMPILE_COMPAT"
3041
fi
3142
}
@@ -46,7 +57,7 @@ function custom_kernel_config__arm64_compat_vdso() {
4657
opts_y+=("COMPAT" "COMPAT_VDSO" "ARM64_32BIT_EL0")
4758

4859
if [[ -f .config ]]; then
49-
kconfig_hit="$(grep -R -n -m1 "COMPAT_VDSO" arch/arm64 Kconfig* 2>/dev/null || true)"
60+
kconfig_hit="$(grep -R -n -m1 "COMPAT_VDSO" arch/arm64 Kconfig* 2> /dev/null || true)"
5061
if [[ -z "${kconfig_hit}" ]]; then
5162
exit_with_error "Selected kernel tree lacks COMPAT_VDSO support for arm64"
5263
fi

0 commit comments

Comments
 (0)