← board

C: auto-search pxx's crtl headers by default (+ -nostdinc)

Problem

pxx searched only user -I roots for <> C includes, then fell back to /usr/include. So #include <stdarg.h> resolved to the host header (wrong ABI, doesn't map to pxx's __builtin_va_*) unless the caller manually passed -Ilib/crtl/include. That bit the sqlite bring-up (a false "invalid symbol in lea") and is a reproducibility footgun — real C programs need pxx's own freestanding/hosted headers on the default path, like any C compiler.

No new language builtin was needed — __builtin_va_arg/va_start/va_end already exist. The gap was purely the default include search path.

What changed

Result

Future (noted, not built)

Tier the headers: freestanding (stdarg/stddef/stdint/stdbool/limits/float) always on; hosted (stdio/stdlib/string) only in hosted mode — matters for ESP/bare. One dir auto-added is enough for the desktop sqlite/lua path now.

Log