{"id":13561268,"url":"https://github.com/michaelforney/cproc","last_synced_at":"2025-04-15T03:41:10.220Z","repository":{"id":45820883,"uuid":"182349746","full_name":"michaelforney/cproc","owner":"michaelforney","description":"C11 compiler (mirror)","archived":false,"fork":false,"pushed_at":"2025-02-11T05:24:15.000Z","size":557,"stargazers_count":760,"open_issues_count":2,"forks_count":51,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-07T23:01:35.607Z","etag":null,"topics":["c","compiler","qbe","unix"],"latest_commit_sha":null,"homepage":"https://sr.ht/~mcf/cproc","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelforney.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-20T02:24:28.000Z","updated_at":"2025-04-01T04:45:54.000Z","dependencies_parsed_at":"2024-04-11T20:31:32.955Z","dependency_job_id":"d8cf7f52-862b-4510-b43d-ae09d19e5041","html_url":"https://github.com/michaelforney/cproc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Fcproc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Fcproc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Fcproc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Fcproc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelforney","download_url":"https://codeload.github.com/michaelforney/cproc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003935,"owners_count":21196794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","compiler","qbe","unix"],"created_at":"2024-08-01T13:00:54.308Z","updated_at":"2025-04-15T03:41:10.182Z","avatar_url":"https://github.com/michaelforney.png","language":"C","readme":"(mirrored on [GitHub][GitHub mirror])\n\n[![builds.sr.ht status](https://builds.sr.ht/~mcf/cproc/commits/master.svg)](https://builds.sr.ht/~mcf/cproc/commits/master)\n\n`cproc` is a [C11] compiler using [QBE] as a backend. It is released\nunder the [ISC] license.\n\nSome [C23 features] and [GNU C extensions] are also implemented.\n\nThere is still much to do, but it currently implements most of the\nlanguage and is capable of [building software] including itself, mcpp,\ngcc 4.7, binutils, and more.\n\nIt was inspired by several other small C compilers including [8cc],\n[c], [lacc], and [scc].\n\n## Requirements\n\nThe compiler itself is written in standard C99 and can be built with\nany conforming C99 compiler.\n\nThe POSIX driver depends on POSIX.1-2008 interfaces, and the `Makefile`\nrequires a POSIX-compatible make(1).\n\nAt runtime, you will need QBE, an assembler, and a linker for the\ntarget system. Since the preprocessor is not yet implemented, an\nexternal one is currently required as well.\n\n## Supported targets\n\nAll architectures supported by QBE should work (currently x86\\_64,\naarch64, and riscv64).\n\nThe following targets are tested by the continuous build and known to\nbootstrap and pass all tests:\n\n- `x86_64-linux-musl`\n- `x86_64-linux-gnu`\n- `x86_64-freebsd`\n- `aarch64-linux-musl`\n- `aarch64-linux-gnu`\n- `riscv64-linux-gnu`\n\n## Building\n\nRun `./configure` to create a `config.h` and `config.mk` appropriate for\nyour system. If your system is not supported by the configure script,\nyou can create these files manually. `config.h` should define several\nstring arrays (`static char *[]`):\n\n- **`startfiles`**: Objects to pass to the linker at the beginning of\n  the link command.\n- **`endfiles`**: Objects to pass to the linker at the end of the link\n  command (including libc).\n- **`preprocesscmd`**: The preprocessor command, and any necessary flags\n  for the target system.\n- **`codegencmd`**: The QBE command, and possibly explicit target flags.\n- **`assemblecmd`**: The assembler command.\n- **`linkcmd`**: The linker command.\n\nYou may also want to customize your environment or `config.mk` with the\nappropriate `CC`, `CFLAGS` and `LDFLAGS`.\n\nOnce this is done, you can build with\n\n\tmake\n\n### Bootstrap\n\nThe `Makefile` includes several other targets that can be used for\nbootstrapping. These targets require the ability to run the tools\nspecified in `config.h`.\n\n- **`stage2`**: Build the compiler with the initial (`stage1`) output.\n- **`stage3`**: Build the compiler with the `stage2` output.\n- **`bootstrap`**: Build the `stage2` and `stage3` compilers, and verify\n  that they are byte-wise identical.\n\n## What's missing\n\n- Digraph sequences ([6.4.6p3], will not be implemented).\n- Variable-length arrays ([#1]).\n- `volatile`-qualified types ([#7]).\n- `long double` type ([#3]).\n- Inline assembly ([#5]).\n- Preprocessor ([#6]).\n- Generation of position independent code (i.e. shared libraries,\n  modules, PIEs).\n\n## Mailing list\n\nThere is a mailing list at [~mcf/cproc@lists.sr.ht]. Feel free to\nuse it for general discussion, questions, patches, or bug reports\n(if you don't have an sr.ht account).\n\n## Issue tracker\n\nPlease report any issues to [~mcf/cproc@todo.sr.ht].\n\n## Contributing\n\nPatches are greatly appreciated. Send them to the mailing list\n(preferred), or as pull-requests on the [GitHub mirror].\n\n[QBE]: https://c9x.me/compile/\n[C11]: http://port70.net/~nsz/c/c11/n1570.html\n[ISC]: https://git.sr.ht/~mcf/cproc/blob/master/LICENSE\n[C23 features]: https://man.sr.ht/~mcf/cproc/doc/c23.md\n[GNU C extensions]: https://man.sr.ht/~mcf/cproc/doc/extensions.md\n[building software]: https://man.sr.ht/~mcf/cproc/doc/software.md\n[8cc]: https://github.com/rui314/8cc\n[c]: https://github.com/andrewchambers/c\n[lacc]: https://github.com/larmel/lacc\n[scc]: http://www.simple-cc.org/\n[5.2.1.1]: http://port70.net/~nsz/c/c11/n1570.html#5.2.1.1\n[6.4.6p3]: http://port70.net/~nsz/c/c11/n1570.html#6.4.6p3\n[#1]: https://todo.sr.ht/~mcf/cproc/1\n[#3]: https://todo.sr.ht/~mcf/cproc/3\n[#5]: https://todo.sr.ht/~mcf/cproc/5\n[#6]: https://todo.sr.ht/~mcf/cproc/6\n[#7]: https://todo.sr.ht/~mcf/cproc/7\n[#35]: https://todo.sr.ht/~mcf/cproc/35\n[#44]: https://todo.sr.ht/~mcf/cproc/44\n[~mcf/cproc@lists.sr.ht]: https://lists.sr.ht/~mcf/cproc\n[~mcf/cproc@todo.sr.ht]: https://todo.sr.ht/~mcf/cproc\n[GitHub mirror]: https://github.com/michaelforney/cproc\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelforney%2Fcproc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelforney%2Fcproc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelforney%2Fcproc/lists"}