nanofil/nix/nanofil-cc.nix
nanofil-cc: a CC for building C packages with nanofil. A compile (-c of one .c file) is preprocessed by filcc with the same flags, compiled by nanofil (with $NANOFIL_OPT, e.g. -O) and assembled by GNU as, and the object's name is appended to $NANOFIL_LOG; -std=c23 or gnu23 also sets NANOFIL_STD=c23, so nanofil reads C23's keywords, and C90 modes or -fgnu89-inline set NANOFIL_STD=gnu89, for GNU inline semantics; -fno-builtin, -fno-builtin-memcpy, -fno-builtin-memmove and -ffreestanding keep every memcpy and memmove a call (--memcpy=call); -fno-inline and -O0 select --inline=none; -fcommon sets NANOFIL_COMMON=1, so tentative definitions are common (weak) symbols; -fno-math-errno sets NANOFIL_MATH_ERRNO=0, so __builtin_sqrt is the IR's sqrt rather than a call of libm's, which sets errno. __SIZEOF_INT128__ and __BITINT_MAXWIDTH__ are not defined, since nanofil refuses __int128 and has no _BitInt. With NANOFIL_KEEP_I=DIR the preprocessed file is also copied into DIR. Anything else (linking, configure probes) goes to filcc unchanged. On SWI, nanofil runs from a saved state built here, which starts in 0.05 s instead of 0.26 s. With terms = true (rocq-gate.nix) a compile instead writes the checked module nanofil would emit (checked-terms) into $NANOFIL_TERMS and takes the object from filcc, so the build still links.
| pkgs | |
| filcc | |
The nanofil tree to run; the survey passes one of only bin/ and src/. | |
| src | default ../. |
| terms | default false |