brintos

brintos / linux public Read only

0
0

arch/wasm32/kernel/hwjs_thunks.ll missing from the tree — swallowed by the *.ll gitignore; fresh clone can't build the kernel #2

Closed sasha opened this issue · 1 comment
S sasha commented

arch/wasm32/kernel/Makefile compiles hwjs_thunks.ll as a source ($(obj)/hwjs_thunks.o: $(src)/hwjs_thunks.ll) — hand-written LLVM-IR (the resume/done/destroy coroutine thunks; they can't be a C TU because clang gates __builtin_coro_* behind C++ coroutines, exactly like hwjs-cc's own fixtures/coro_thunks.ll and musl's committed arch/wasm32/hwjs_user_thunks.ll). But the file is not in the repo at any commit — a fresh clone / make kernel dies with:

make[7]: *** No rule to make target 'arch/wasm32/kernel/hwjs_thunks.ll', needed by 'arch/wasm32/kernel/hwjs_thunks.o'.  Stop.

Root cause: the stock top-level .gitignore *.ll rule (line 32, in the generic build-artifact block) silently ignores this hand-written source. git check-ignore confirms *.ll matches it; git log --all shows it was never committed, because git add arch/wasm32/kernel/hwjs_thunks.ll is a silent no-op (needs -f). On the maintainer's machine the file exists and the kernel builds; it just never got force-added, so the fork ships without it. (The userland twin packages/modified/musl/arch/wasm32/hwjs_user_thunks.ll is committed — musl's .gitignore has no *.ll rule.)

Reproduction: fresh super-repo at ea2c034, make toolchain, make kernel -> No rule to make target 'arch/wasm32/kernel/hwjs_thunks.ll'.

Environment: super-repo ea2c034, linux pin 3bb77e2e.

Proposed fix

The load-bearing part is un-ignoring the path so the source can be committed — add a local arch/wasm32/kernel/.gitignore:

--- /dev/null
+++ b/arch/wasm32/kernel/.gitignore
@@ -0,0 +1 @@
+!hwjs_thunks.ll

(Verified: with this in place, git status lists arch/wasm32/kernel/hwjs_thunks.ll as a plain untracked file — a normal git add, no -f.)

Then commit your canonical arch/wasm32/kernel/hwjs_thunks.ll. I'm deliberately not committing the file here — the authoritative copy should come from you. If the original was lost too, hwjs-cc's fixtures/coro_thunks.ll is a known-working reference: its hwjs_resume/hwjs_done/hwjs_destroy signatures match the callers in entry.c, the weak __hwjs_frame_publish is overridden by the strong definition in hwjs_rt.c, and make kernel builds + links vmlinux.wasm (10.9 MB) with it.

Proposed fix targets brintos/linux only — no distro submodule pins moved. All distros share one lineage, so pin bumps are coordinated on merge, not per-engineer.

S sasha commented

Fixed upstream — the wasm32 / joel-dev tip (af9378c7, past this issue's pin 3bb77e2e) now commits arch/wasm32/kernel/hwjs_thunks.ll plus a local arch/wasm32/kernel/.gitignore with !hwjs_thunks.ll negating the blanket top-level *.ll rule — exactly the approach proposed here. The committed file is the canonical maintainer copy (differs from the hwjs-cc fixture I referenced as a fallback). A fresh clone at that tip builds. Good to close — thanks!

sasha closed this as completed