|Michael Forney f0465801c1 Fix non-adjacent bit-fields||1 week ago|
|.builds||2 weeks ago|
|doc||3 weeks ago|
|qbe @ 1f87c9c943||3 weeks ago|
|test||1 week ago|
|.gitignore||4 months ago|
|.gitmodules||1 month ago|
|LICENSE||1 month ago|
|Makefile||1 month ago|
|README.md||4 weeks ago|
|arg.h||2 months ago|
|cc.h||3 weeks ago|
|configure||2 weeks ago|
|decl.c||1 week ago|
|driver.c||4 weeks ago|
|eval.c||4 weeks ago|
|expr.c||1 month ago|
|init.c||1 month ago|
|main.c||1 month ago|
|map.c||1 month ago|
|ops.h||3 months ago|
|pp.c||3 weeks ago|
|qbe.c||2 weeks ago|
|runtests||2 months ago|
|scan.c||1 month ago|
|scope.c||2 months ago|
|siphash.c||4 months ago|
|stmt.c||1 month ago|
|token.c||1 month ago|
|tree.c||2 months ago|
|type.c||1 month ago|
|util.c||4 months ago|
|util.h||2 months ago|
(mirrored on GitHub)
Several GNU C extensions are also implemented.
There is still much to do, but it currently implements most of the language and is capable of building software including itself, mcpp, gcc 4.7, binutils, and more.
The compiler itself is written in standard C11 and can be built with any conforming C11 compiler.
The POSIX driver depends on POSIX.1-2008 interfaces, and the
requires a POSIX-compatible make(1).
At runtime, you will need QBE, an assembler, and a linker for the target system. Currently, my personal QBE branch is recommended, since it may address some issues that have not yet made it upstream. Since the preprocessor is not yet implemented, an external one is currently required as well.
All architectures supported by QBE should work (currently x86_64 and aarch64).
The following targets are tested by the continuous build and known to bootstrap and pass all tests:
./configure to create a
config.mk appropriate for
your system. If your system is not supported by the configure script,
you can create these files manually.
config.h should define several
string arrays (
static char *):
startfiles: Objects to pass to the linker at the beginning of the link command.
endfiles: Objects to pass to the linker at the end of the link command (including libc).
preprocesscmd: The preprocessor command, and any necessary flags for the target system.
codegencmd: The QBE command, and possibly explicit target flags.
assemblecmd: The assembler command.
linkcmd: The linker command.
You may also want to customize your environment or
config.mk with the
If you don't have QBE installed, you can build it from the included submodule (NOTE: BSD users will need to use gmake here), then add it to your PATH so that the driver will be able to run it.
make qbe PATH=$PWD/qbe/obj:$PATH
Once this is done, you can build with
Makefile includes several other targets that can be used for
bootstrapping. These targets require the ability to run the tools
stage2: Build the compiler with the initial (
stage3: Build the compiler with the
bootstrap: Build the
stage3compilers, and verify that they are byte-wise identical.
volatile-qualified types (#7).
_Thread_localstorage-class specifier (#5).
long doubletype (#3).
Please report any issues to https://todo.sr.ht/~mcf/cc-issues.
Send patches to me (address in commit log), or pull-requests on the GitHub mirror. Once I decide on a project name, a mailing list will be created, which will then become the preferred form of contribution.