build: pin CROSS_COMPILE for the U-Boot defconfig, and silence statx - #320
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 compilerdo_buildpinnedCROSS_COMPILEper platform,do_configuredid not. Somake <platform>_defconfigfell back to the Makefile's patched-inaarch64-none-linux-gnu-default. That step probes the compiler(
scripts/gcc-version.sh,clang-version.sh), so with the toolchain absentKconfig dies with
syntax errorand the build stops before compilinganything:
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 arm32Every
lsprintedsyscall_handle: unhandled syscall: 397per entry. 397 isstatxon arm32, and MUSL reaches for it first: infstatat.c,sizeof(kstat.st_atime_sec) < sizeof(time_t)holds on a 32-bit time64 build,so
__fstatattriesstatxand only falls back tofstatat64on-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
kstatalready carries 64-bit times and MUSLgoes straight to
newfstatat.syscall.tblalready models exactly this case. Mapping it toemptymakes__sys_empty()return-ENOSYSsilently, asmunmapandmprotectalreadydo. Behaviour is unchanged, the noise is gone.
Testing
Both verified on
virt32(QEMUvirt, Cortex-A15), kernel v6.3.0: a fullbsp-so3build and deploy inside the 32-bit container now completes, andls -lruns with zerounhandled syscalllines.🤖 Generated with Claude Code
https://claude.ai/code/session_012cxnJsuSbSBYtEi5nrgb68