sandlock icon indicating copy to clipboard operation
sandlock copied to clipboard

build: skip unused C stubs and honor cross-compilation toolchains

Open congwang-mk opened this issue 1 month ago • 0 comments

Compile checkpoint and chroot C stubs only when their features are enabled. Honor target compiler configuration, including musl cross compilers, rather than requiring GNU-named tools. A minimal shell backend should build without a C toolchain for unused features.

From Łukasz’s kamchatka integration feedback, request No. 10

Also: build.rs writes tests/rootfs-helper into the source tree instead of OUT_DIR (a git dependency writes into cargo's checkout), and that compile only tries musl-gcc/cc. The shebang trampoline is built unconditionally (no chroot feature) and its failure is fatal on x86_64, aarch64 and riscv64; its compiler candidates ignore CC_<target>/TARGET_CC, though any compiler for the target arch (e.g. aarch64-linux-musl-gcc) would do since it is freestanding.

congwang-mk avatar Oct 12 '26 19:10 congwang-mk