Skip to content

v2.8.19

Choose a tag to compare

@Pantelis23 Pantelis23 released this 27 Apr 21:36

Three stacked bugs that prevented .krbo fat binaries from running in Termux on Android 14+, plus four signed-arithmetic / mixed-float codegen-correctness fixes.

Termux runner

  • runner.kr argv-shift detection now matches argv[0] == argv[1] (Termux's exec wrapper duplicates the binary path), so kr --version no longer parses --version as a .krbo path and SIGBUS on garbage.
  • New kr-runner Make target that concatenates runner.kr + bcj.kr. Building the runner alone left filter_aarch64_bcj / filter_x86_64_bcj unresolved and silently corrupted every extracted slice (entry-point bytes clobbered → SIGBUS at startup).
  • packaging/kr.sh shell wrapper that catches the runner's exit-120 and re-execs ./kr-exec from the user's shell context. Raw execve from the runner's app SELinux domain hits EACCES because Termux wraps execve via libc LD_PRELOAD and our svc 0 syscall bypasses it; the user's shell context has the wrapper engaged so the re-exec succeeds.

Compiler correctness

  • Mixed f32/f64 in BinOp + Assign — widen the narrower side to f64 in float arithmetic. a + 1.0 for f32 a no longer silently reads zero (low 32 bits of f64 1.0).
  • Signed-aware compareint64 var < 0 now actually fires. Added a parallel ir_vreg_signed_buf byte array; int8/16/32/64 declarations tag it, BinOp/Assign propagate, ordering compares pick IR_SCMP_* over unsigned IR_CMP_*. uint* stays unsigned.
  • Signed /, %, >> — new IR_SDIV (132), IR_SMOD (133), IR_SAR (134) emit cqo + idiv / asr on x86 and aarch64. Mirrored in the legacy backend with AST-derived signedness (legacy_node_is_signed).

Verified on Z Fold 5 / Android 16 / Termux: kr program.krbo runs and exits 0. Bootstrap fixed point at 1,240,432 bytes; 439/439 tests pass.

Full Changelog: v2.8.18...v2.8.19

Full Changelog: v2.8.18...v2.8.19