NOTE - This project is not being actively developed. Please direct yourself to https://awesomeopensource.com/project/michaelforney/cc which is a successor that is more complete. I direct my own fixes to that project instead now.
You should be able to get a C compiler, assembler, linker and libc for any supported target in less than 30 seconds.
Requires an external C compiler and gnu binutils (for now), and I have only tested it on linux 64 bit so far.
The code does use anonymous union extensions, so your compiler will need to support them too.
$ make test $ make selfhost # self hosting
Self hosting x86_64, dumb backend.
Self hosting arm, something like raspberry pi/android.
Build small clean C code bases like 8cc, tcc, sbase.
Build musl libc.
Pre stage 2. Self hosting with lots of missing common cases. Though technically these bugs can be fixed with the compiler itself :). It uses it's own stubbed out headers and cannot correctly process system headers yet (Help wanted).
Project on hold. See https://awesomeopensource.com/project/michaelforney/cc for a new compiler project that is more complete.
If you are unsure about the purpose of a library, check the header which should give a short description.
Follow Plan9 style conventions. Headers are not allowed to include other headers to eliminate circular dependencies and increase build speed. src/u.h is the only exception to this rule.
Try and attach a single source file which exibits your issue. If possible reduce the test case by hand until it is as small as possible.
Try and follow the general template changed where needed:
What are you trying to do: ... What you expected to happen: ... What actually hapened: ...
Try and add a small self contained file which reproduces the issue.
In general each bug fix or change should add a test file which triggers the bug.
The compiler does not explicitly free memory. Peak memory usage while self hosting is approximately 2Mb, so it should not be an issue, even for planned targets/hosts like the raspberry pi.
This actually simplifies the code and probably makes it faster because allocations can be pointer bumps.