From 72372606e9a07fac32bf79b39a4ec2ee3123f24e Mon Sep 17 00:00:00 2001 From: Daniel Rossier Date: Sat, 22 Aug 2026 16:10:41 +0200 Subject: [PATCH] build: pin CROSS_COMPILE for the U-Boot defconfig, and silence statx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes that only show up away from a 64-bit workstation, both found while building a 32-bit tree inside a container that ships no aarch64 toolchain. uboot: do_build pinned CROSS_COMPILE per platform but do_configure did not, so `make _defconfig` fell back to the Makefile's patched-in aarch64-none-linux-gnu- default. The defconfig step probes the compiler (scripts/gcc-version.sh, clang-version.sh); with that toolchain absent, Kconfig dies with "syntax error" and the build stops before it has compiled anything. A host that happens to have the 64-bit toolchain installed hides it — which is why it survived this long. so3: every `ls` printed one "unhandled syscall: 397" per directory entry on arm32. 397 is statx, and MUSL reaches for it first: in fstatat.c, `sizeof(kstat.st_atime_sec) < sizeof(time_t)` holds on a 32-bit time64 build, so __fstatat tries statx and only falls back to fstatat64 on -ENOSYS. The fallback worked and the listing was correct, but the table entry was NULL so the kernel logged the miss first. It never showed on arm64, where kstat already carries 64-bit times and MUSL goes straight to newfstatat. syscall.tbl already models this case: map it to `empty` and __sys_empty() returns -ENOSYS silently, as munmap and mprotect already do. Behaviour unchanged, noise gone. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_012cxnJsuSbSBYtEi5nrgb68 --- .../meta-uboot/recipes-uboot/uboot/uboot_2022.04.bb | 12 ++++++++++-- so3/so3/syscall.tbl | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build/meta-uboot/recipes-uboot/uboot/uboot_2022.04.bb b/build/meta-uboot/recipes-uboot/uboot/uboot_2022.04.bb index f47d5910e3..9eac7377ce 100644 --- a/build/meta-uboot/recipes-uboot/uboot/uboot_2022.04.bb +++ b/build/meta-uboot/recipes-uboot/uboot/uboot_2022.04.bb @@ -55,10 +55,18 @@ do_configure () { # - verdin platforms: ${IB_PLATFORM}_defconfig (verdin uses # uboot_2024.07.bb anyway). + # CROSS_COMPILE has to be pinned here too, not only in do_build: the + # U-Boot Makefile carries a patched-in default of + # aarch64-none-linux-gnu-, and the defconfig step probes the compiler + # (scripts/gcc-version.sh, clang-version.sh). On a 32-bit platform, or + # in a container that ships no 64-bit toolchain, that default is simply + # absent and Kconfig dies with "syntax error". A host that happens to + # have the 64-bit toolchain installed hides the bug. + if [ "${IB_PLATFORM}" = "virt64" ] && [ "${IB_BOOT_CHAIN}" = "uboot" ]; then - make qemu_arm64_defconfig + make CROSS_COMPILE=${IB_TOOLCHAIN}- qemu_arm64_defconfig else - make ${IB_PLATFORM}_defconfig + make CROSS_COMPILE=${IB_TOOLCHAIN}- ${IB_PLATFORM}_defconfig fi # Specific handling for bbb platform diff --git a/so3/so3/syscall.tbl b/so3/so3/syscall.tbl index fc0556aeb5..01523d63e3 100644 --- a/so3/so3/syscall.tbl +++ b/so3/so3/syscall.tbl @@ -41,6 +41,7 @@ utimensat utimensat stat64 stat64 fstatat64 fstatat64 newfstatat newfstatat +statx empty mmap mmap mmap2 mmap2 nanosleep nanosleep