{"id":19297286,"url":"https://github.com/gifnksm/gifcc","last_synced_at":"2026-02-12T14:24:49.392Z","repository":{"id":136978013,"uuid":"164391246","full_name":"gifnksm/gifcc","owner":"gifnksm","description":"Tiny c compiler","archived":false,"fork":false,"pushed_at":"2019-09-14T00:34:40.000Z","size":935,"stargazers_count":58,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-09T23:02:26.444Z","etag":null,"topics":["c","compiler","self-hosted","toy-project"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gifnksm.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-01-07T06:58:41.000Z","updated_at":"2024-11-02T07:25:47.000Z","dependencies_parsed_at":"2023-03-22T12:17:05.356Z","dependency_job_id":null,"html_url":"https://github.com/gifnksm/gifcc","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/gifnksm%2Fgifcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gifnksm%2Fgifcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gifnksm%2Fgifcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gifnksm%2Fgifcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gifnksm","download_url":"https://codeload.github.com/gifnksm/gifcc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250214918,"owners_count":21393696,"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","self-hosted","toy-project"],"created_at":"2024-11-09T23:01:50.438Z","updated_at":"2026-02-12T14:24:49.362Z","avatar_url":"https://github.com/gifnksm.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# gifcc [![CircleCI](https://circleci.com/gh/gifnksm/gifcc.svg?style=svg)](https://circleci.com/gh/gifnksm/gifcc) [![codecov](https://codecov.io/gh/gifnksm/gifcc/branch/master/graph/badge.svg)](https://codecov.io/gh/gifnksm/gifcc)\n\n\"gifcc\" is a self-hosted C compiler written by gifnksm.\n\n## Features\n\n* emit x86_64 assembly (AT\u0026T syntax or Intel syntax)\n* self-hosted\n* Many C11 features\n* Some GNU syntax extension\n\n## Compiler Stages\n\ngifcc build process has 3 stages.\n\n* stage1: gifcc binary built with system's C compiler (gcc)\n* stage2: gifcc binary built with stage1 gifcc\n* stage3: gifcc binary built with stage2 gifcc\n\nIf gifcc compiles C source code correctly, stage2 binary and stage3 binary will be identical.\n\n## Requirements\n\n* C development tools (gcc, GNU Make, ...)\n* python3\n* [TMSU](https://github.com/oniony/TMSU) (for running c-testsuite)\n\n## Operations\n\n* Build stage1, 2, 3 compiler\n\n   ```console\n   $ make stage1\n   ...\n   $ make stage2\n   ...\n   $ make stage3\n   ...\n   ```\n\n* Run basic tests for each stages\n\n    ```console\n    $ make stage1-test\n    ...\n    $ make stage2-test\n    ...\n    $ make stage3-test\n    ...\n    ```\n\n* Run all tests for each stages\n\n    ```console\n    $ make stage1-test-full\n    ...\n    $ make stage2-test-full\n    ...\n    $ make stage3-test-full\n    ...\n    ```\n\n## Special Thanks\n\n* [低レイヤを知りたい人のためのCコンパイラ作成入門](https://www.sigbus.info/compilerbook)\n* [できる！　コンパイラ作成の資料まとめ](https://anqou.net/poc/2019/01/03/post-2650/)\n* [Compiler Explorer](https://godbolt.org/)\n* [Wandbox](https://wandbox.org/)\n* [Dave Prosser's C Preprocessing Algorithm](https://www.spinellis.gr/blog/20060626/)\n* [c-testsuite](https://github.com/c-testsuite/c-testsuite)\n\n## References\n\n* [Programming languages — C](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf)\n* [x86 and amd64 instruction reference](https://www.felixcloutier.com/x86/index.html)\n* [System V Application Binary Interface](https://www.uclibc.org/docs/psABI-x86_64.pdf)\n* [GNU as](https://sourceware.org/binutils/docs/as/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgifnksm%2Fgifcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgifnksm%2Fgifcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgifnksm%2Fgifcc/lists"}