{"id":20981977,"url":"https://github.com/lowrisc/crt","last_synced_at":"2025-12-29T23:07:31.398Z","repository":{"id":54926197,"uuid":"519368748","full_name":"lowRISC/crt","owner":"lowRISC","description":"Compiler Repository Toolkit","archived":false,"fork":false,"pushed_at":"2025-03-10T16:19:20.000Z","size":176,"stargazers_count":3,"open_issues_count":2,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-10T16:37:02.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"cfrantz/crt","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lowRISC.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":"2022-07-29T22:58:45.000Z","updated_at":"2025-03-10T16:19:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"c8e6d0b3-e2bc-4f0c-9921-1b40eacbd0a1","html_url":"https://github.com/lowRISC/crt","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowRISC%2Fcrt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowRISC%2Fcrt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowRISC%2Fcrt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowRISC%2Fcrt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lowRISC","download_url":"https://codeload.github.com/lowRISC/crt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243384240,"owners_count":20282316,"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":[],"created_at":"2024-11-19T05:42:06.491Z","updated_at":"2025-12-29T23:07:31.356Z","avatar_url":"https://github.com/lowRISC.png","language":"Starlark","readme":"# Compiler Repository Toolkit\n\nThe Compiler Repository Toolkit is a set of bazel rules meant to make building\na C/C++ toolchain easier.\n\nThis was inspired by [bazel-embedded](https://github.com/bazelembedded/bazel-embedded);\nI hope I've managed to improve things.\n\n## Features\n\n- Simplified toolchain setup.\n- A bazel-ish approach to compiler features and flags.\n- More concise target device configuration.\n- Emulator configuration for executing target code\n\n### Simplified toolchain setup\n\nEach of the toolchains is configured in `//toolchains/...` by two files.\n- `repository.bzl` describes the path or URL to the compiler archive.\n- `BUILD.bzl` initializes the toolchains for each target device.  Most of the\n  configuration comes from the individual device configurations (more on that\n  later).  The other elemets of the `BUILD.bazel` file describe the files\n  which make up the compiler and the various include paths needed by the\n  compiler.\n\n### A bazel-ish approach to compiler features and flags\n\nCompiler featurs and flags are defined by a `feature_set` which aggregates\ncompiler flags for activating different features, such as optimization modes\nor warning levels.  The `feature_set` aggregates a collection of `feature`\nrules together and provides a facility for supplying substitutions to those\nflags so that minor variations in configuration don't require an entire new\nconfiguration.  Feature sets may be chained together; features supplied later\nin the chain override features earlier in the chain.  Substitutions may be\nsupplied at any point in the `feature_set` chain _or_ by the device\nconfiguration.\n\n### More concise target device configuration\n\nTarget devices are defined in `//platforms/\u003carch\u003e/devices.bzl`.  Each\ndevice configuration creates a device struct containing the architecture,\nconstraints, feature set and substitutions to supply to the feature set.\n\nEach target device should correspond to a bazel `platform` definition.\nBazel will use the platform constraints to select the toolchain for the\ndevice with the same constraints.\n\n### Emulator configuration for target code\n\nIn addition to defining the toolchains, `crt` also defines an `exec_config`\nthat can be used to execute target code under a system emulator.  Sample\nconfigurtions using `qemu` are supplied.\n\n## How to use\n\nIn your `WORKSPACE` file, add:\n\n```\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\nhttp_archive(\n    name = \"crt\",\n    url = \"https://github.com/cfrantz/crt/archive/refs/tags/v0.3.0.tar.gz\",\n    sha256 = \"...\",\n    strip_prefix = \"crt-0.3.0\",\n)\n\nload(\"@crt//:repos.bzl\", \"crt_repos\")\ncrt_repos()\nload(\"@crt//:deps.bzl\", \"crt_deps\")\ncrt_deps()\n\nload(\"@crt//config:registration.bzl\", \"crt_register_toolchains\")\ncrt_register_toolchains(\n    arm = True,     # Pick the toolchains you want.\n    m6502 = True,\n    riscv32 = True,\n    win64 = True,\n)\n```\n\n## Releasing CRT\n\nTo perform a release of CRT, run the [Create Release](https://github.com/lowRISC/crt/actions/workflows/create_release.yml) workflow.\nFor the `release_tag` parameter, supply the tag name for the new release, e.g. \"v0.4.2\".\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flowrisc%2Fcrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flowrisc%2Fcrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flowrisc%2Fcrt/lists"}