code wiki / _hdl_build / nx_cand_build_run.nx
nx_cand_build_run.nx
buildroot/runtime/_hdl_build/nx_cand_build_run.nx
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
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
structs
| none |
consts
| 11 | const CBR_MAGIC_65536: i64 = 65536 |
| 13 | const CBR_MIN_ASM: i64 = 128 |
| 14 | const CBR_RETRIES: i64 = 14 |
| 15 | const LIVE_CC: *u8 = "_offc/nx_cc_sovereign.elf" |
| 16 | const ASM_TOOL: *u8 = "_offc/nxasm_x86_main.elf" |
| 17 | const CAND_SRC: *u8 = "runtime/nx_compile_x86.nx" |
| 18 | const CAND_S: *u8 = "/tmp/candcc.s" |
| 19 | const CAND_CC: *u8 = "/tmp/candcc.elf" |
functions
| 21 | func 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 } |
| 26 | func cbr_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 27 | func 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 |
| 29 | func cbr_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64 |
| 42 | func cbr_filesize(path: *u8) -> i64 |
| 50 | func cbr_build(compiler: *u8, srcpath: *u8, sout: *u8, eout: *u8, envp: *i64, devnull: i64) -> i64 |
| 69 | func main(argc: i64, argv: *i64) -> i64 |