code wiki / _hdl_build / nx_cand_build_run.nx

nx_cand_build_run.nx

buildroot/runtime/_hdl_build/nx_cand_build_run.nx

5689 B101 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_cand_build_run.nx -- build a CANDIDATE sovereign compiler from current source and use it to build+run a target module, WITHOUT swapping the live _offc/nx_cc_sovereign.elf. This is the zero-risk way to exercise a NEW compiler intrinsic (here __mul256_wide): the live compiler that ~7400 organs depend on is never touched; the candidate lives only at /tmp. phase 1: live cc compiles runtime/nx_compile_x86.nx -> /tmp/candcc.s ; nxasm -> /tmp/candcc.elf phase 2: candcc compiles runtime/<argv1>.nx -> /tmp/<argv1>.s ; nxasm -> /tmp/<argv1>.elf ; run it Retry-guards nx_cc's empty/truncated-.s nondeterminism (same guard as nx_sov_build_run). Usage: nx_cand_build_run <module-basename-in-runtime>. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_cand_build_run.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main cbr_puts sys_write sys_mmap sys_openat_wr cbr_build sys_openat_wr ↻ sys_mmap ↻ cbr_run sys_fork sys_dup3 sys_execve sys_exit sys_mmap ↻ sys_wait4 sys_close cbr_filesize sys_openat_rd sys_mmap ↻ sys_read sys_close ↻ sys_exit ↻ cbr_cat sys_openat_rd ↻ sys_close ↻ cbr_run ↻ cbr_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

11const CBR_MAGIC_65536: i64 = 65536
13const CBR_MIN_ASM: i64 = 128
14const CBR_RETRIES: i64 = 14
15const LIVE_CC: *u8 = "_offc/nx_cc_sovereign.elf"
16const ASM_TOOL: *u8 = "_offc/nxasm_x86_main.elf"
17const CAND_SRC: *u8 = "runtime/nx_compile_x86.nx"
18const CAND_S: *u8 = "/tmp/candcc.s"
19const CAND_CC: *u8 = "/tmp/candcc.elf"

functions

21func cbr_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
26func cbr_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
27func cbr_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i }
called by 1: main
29func cbr_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64
42func cbr_filesize(path: *u8) -> i64
50func cbr_build(compiler: *u8, srcpath: *u8, sout: *u8, eout: *u8, envp: *i64, devnull: i64) -> i64
69func main(argc: i64, argv: *i64) -> i64