Skip to content

build: pin CROSS_COMPILE for the U-Boot defconfig, and silence statx - #320

Merged
daniel-rossier merged 1 commit into
mainfrom
fix/uboot-defconfig-cross-compile-and-statx
Aug 22, 2026
Merged

build: pin CROSS_COMPILE for the U-Boot defconfig, and silence statx#320
daniel-rossier merged 1 commit into
mainfrom
fix/uboot-defconfig-cross-compile-and-statx

Conversation

@daniel-rossier

Copy link
Copy Markdown
Contributor

Two fixes that only surface away from a 64-bit workstation. Both were found
while building a 32-bit tree inside a container that ships no aarch64
toolchain, which is why they survived this long.

uboot: the defconfig step used the wrong compiler

do_build pinned CROSS_COMPILE per platform, do_configure did not. So
make <platform>_defconfig fell back to the Makefile's patched-in
aarch64-none-linux-gnu- default. That step probes the compiler
(scripts/gcc-version.sh, clang-version.sh), so with the toolchain absent
Kconfig dies with syntax error and the build stops before compiling
anything:

/bin/sh: 1: aarch64-none-linux-gnu-gcc: not found
Kconfig:66: syntax error
make[1]: *** [scripts/kconfig/Makefile:96: virt32_defconfig] Error 1

A host that happens to have the 64-bit toolchain installed hides it — the
defconfig step does not really compile, it only asks for a version.

so3: one "unhandled syscall" per directory entry on arm32

Every ls printed syscall_handle: unhandled syscall: 397 per entry. 397 is
statx on arm32, 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 — listings were correct — but the table entry was NULL,
so the kernel logged the miss first.

It never showed on arm64: there kstat already carries 64-bit times and MUSL
goes straight to newfstatat.

syscall.tbl already models exactly this case. Mapping it to empty makes
__sys_empty() return -ENOSYS silently, as munmap and mprotect already
do. Behaviour is unchanged, the noise is gone.

Testing

Both verified on virt32 (QEMU virt, Cortex-A15), kernel v6.3.0: a full
bsp-so3 build and deploy inside the 32-bit container now completes, and
ls -l runs with zero unhandled syscall lines.

🤖 Generated with Claude Code

https://claude.ai/code/session_012cxnJsuSbSBYtEi5nrgb68

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 <platform>_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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012cxnJsuSbSBYtEi5nrgb68
@daniel-rossier
daniel-rossier merged commit d6fff03 into main Aug 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant