code wiki / _hdl_build / nx_ccdiag.nx

nx_ccdiag.nx

buildroot/runtime/_hdl_build/nx_ccdiag.nx

4619 B69 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_ccdiag.nx -- ONE-STEP build diagnostic (<10s): why did `nx_sov_build_run <name>` fail with "empty .s"? The runner MUTES nx_cc's stderr (2>/dev/null) + retries 12x, so a plain source error (undefined function, parse error, arg-count) surfaces only as a mysterious "COMPILE-FAIL (empty .s after retries)" -- which cost a ~15-build blind hunt. This tool runs the SAME sovereign compiler on the SAME source with stderr VISIBLE, once, and prints the exit code + .s size + the real diagnostic line. Eats the debt: turn opaque empty-.s into the actual cause in one look. Usage: nx_ccdiag <module-name> license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_ccdiag.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 cd_puts sys_write sys_exit sys_mmap cd_cat cd_exists sys_openat_rd sys_close sys_openat_wr cd_run_cc sys_fork sys_dup3 sys_mmap ↻ sys_execve sys_exit ↻ sys_wait4 sys_close ↻ cd_filesize sys_openat_rd ↻ sys_mmap ↻ sys_read sys_close ↻ cd_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

9const K_MAGIC_65536: i64 = 65536

functions

11func cd_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
16func cd_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
17func cd_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){d[o+i]=s[i]; i=i+1} return o+i }
called by 1: main
18func cd_exists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
19func cd_filesize(p: *u8) -> i64
27func cd_run_cc(cc: *u8, src: *u8, sfd: i64) -> i64
44func main(argc: i64, argv: *i64) -> i64