xv6 is nice, but requires gcc picoc: github.com/Prashant47/picoc guy had the same idea of a self-hosting and self-compiling cc in xv6. No perl, no make, and no funny business in the C compiler. One issue will be the linker. Either go back to binary or a.out format or using ELF (juck).