feat(toolchain): dual-libc support — ulibc default, Newlib optional
Redesign the toolchain build to safely support both ulibc (dynamic
linking) and Newlib (static linking) with a safe-by-default approach:
Architecture:
- adros.h now has Newlib-safe defaults (LIB_SPEC with -ladros, no
dynamic-linker in LINK_SPEC) so a fresh 'git clone' + 'build.sh'
always produces a working toolchain even without prior 'make iso'.
- Step 4b: generates specs from dumpspecs (Newlib-compatible).
- Step 4c: if ulibc build artifacts exist, re-patches specs for ulibc
(removes -ladros, adds -dynamic-linker /lib/ld.so).
- Step 4d: creates newlib.specs + i686-adros-gcc-newlib wrapper for
optional Newlib builds.
Bug fixes for fresh-clone reproducibility:
- Newlib build skip check changed from libc.a (overwritten by ulibc)
to a .built marker file.
- Newlib headers/libs backed up unconditionally (before ulibc check)
so newlib.specs always has valid include/newlib/ directory.
- Bash cross-compilation now uses newlib.specs explicitly (Bash needs
Newlib's full POSIX libc: regex, locale, wchar).
- Wrapper script uses expanded paths instead of hardcoded GCC version.
Usage:
i686-adros-gcc -o out in.c # ulibc dynamic (default)
i686-adros-gcc -static -o out in.c # ulibc static
i686-adros-gcc-newlib -o out in.c # Newlib static