{"id":13864854,"url":"https://github.com/f0rmiga/gcc-toolchain","last_synced_at":"2025-10-09T06:05:21.745Z","repository":{"id":37067235,"uuid":"470343777","full_name":"f0rmiga/gcc-toolchain","owner":"f0rmiga","description":"A fully-hermetic Bazel GCC toolchain for Linux.","archived":false,"fork":false,"pushed_at":"2024-05-01T21:21:26.000Z","size":263,"stargazers_count":104,"open_issues_count":22,"forks_count":24,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-10-29T12:56:25.555Z","etag":null,"topics":["aarch64","armv7","bazel","bazel-rules","c","cpp","fortran","gcc","linux","rbe","x86-64"],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f0rmiga.png","metadata":{"funding":{"github":null,"patreon":null,"open_collective":"aspect-build","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null},"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-03-15T21:56:20.000Z","updated_at":"2024-10-11T21:06:03.000Z","dependencies_parsed_at":"2023-12-15T22:02:52.381Z","dependency_job_id":"cfff85df-0131-4568-b2c1-85078cdb20f3","html_url":"https://github.com/f0rmiga/gcc-toolchain","commit_stats":{"total_commits":134,"total_committers":8,"mean_commits":16.75,"dds":0.3955223880597015,"last_synced_commit":"36e3e1f430871b539ce9261f53491564aa91c170"},"previous_names":["alexeagle/gcc-toolchain","aspect-build/gcc-toolchain"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rmiga%2Fgcc-toolchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rmiga%2Fgcc-toolchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rmiga%2Fgcc-toolchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rmiga%2Fgcc-toolchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f0rmiga","download_url":"https://codeload.github.com/f0rmiga/gcc-toolchain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235053786,"owners_count":18928443,"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":["aarch64","armv7","bazel","bazel-rules","c","cpp","fortran","gcc","linux","rbe","x86-64"],"created_at":"2024-08-05T10:00:54.216Z","updated_at":"2025-10-03T00:31:38.558Z","avatar_url":"https://github.com/f0rmiga.png","language":"Starlark","funding_links":["https://opencollective.com/aspect-build"],"categories":["Starlark","Tooling"],"sub_categories":["Toolchains"],"readme":"# Bazel GCC Toolchain\n\nThis is a fully-hermetic Bazel GCC toolchain for Linux that provides cross-compilation support for\nmultiple architectures. The toolchain includes custom-built GCC binaries and sysroots optimized for\nperformance and portability. You can find the comprehensive documentation under [docs](./docs/).\n\n## Features\n\n- **Multi-architecture**: Support for x86_64, aarch64, and armv7 Linux targets.\n- **Hermetic**: Fully self-contained with no system dependencies.\n- **Optimized**: Reduced toolchain sizes and improved build performance.\n- **Fortran Support**: Complete Fortran compilation, including OpenMP support.\n- **Sanitizers**: Built-in support for AddressSanitizer, LeakSanitizer, ThreadSanitizer,\n  and UndefinedBehaviorSanitizer.\n- **Remote Execution**: Ready for use with Bazel Remote Build Execution (RBE).\n\n## Why Use a Hermetic Toolchain?\n\n### Reproducibility\n\nHermetic toolchains ensure that builds are reproducible across different machines and environments.\nWithout identical headers and libraries, the output produced by Bazel will differ between systems,\nmaking C++ caches unsharable and introducing machine-specific bugs that make the development\nlifecycle unreliable.\n\n### Portability\n\nWhen building portable ELF binaries, the libc version plays a crucial role. The linker attempts to\nlink against newer symbols, and GNU libc's symbol versioning means linking against a newer glibc\nprevents programs from running on systems with older glibc versions. This toolchain ships with glibc\n2.26, providing broad compatibility with modern Linux distributions.\n\n### Performance\n\nThe toolchain has been optimized to reduce size and improve build performance through:\n- Unified GCC binaries and sysroot compilation.\n- Optimized compiler flags and includes.\n- Streamlined dependencies and reduced overhead.\n\n## Use Cases\n\n* **First-party Code**: Your repository contains C/C++/Fortran code.\n* **Sanitizer Testing**: Need to run sanitizers (asan, lsan, tsan, ubsan) on your code.\n* **Cross-compilation**: Build for Linux armv7 or aarch64 from x86_64.\n* **Portability**: Create binaries compatible with any Linux distribution.\n* **Reproducibility**: Ensure consistent builds across development and CI environments.\n* **Remote Execution**: Use with Bazel RBE for distributed builds.\n\n## Quick Start\n\n### Prerequisites\n\n- **Bazel 7+**: This toolchain is tested with Bazel 7.\n- **Linux**: Primary development and testing environment (RBE supports other platforms).\n\n### Installation\n\nAdd to your `WORKSPACE` file:\n\n```bazel\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"gcc_toolchain\",\n    sha256 = \"...\",  # Use the SHA256 of the release\n    urls = [\"https://github.com/f0rmiga/gcc-toolchain/archive/refs/tags/vX.X.X.tar.gz\"],\n)\n\nload(\"@gcc_toolchain//toolchain:repositories.bzl\", \"gcc_toolchain_dependencies\")\n\ngcc_toolchain_dependencies()\n\nload(\"@gcc_toolchain//toolchain:defs.bzl\", \"gcc_register_toolchain\", \"ARCHS\")\n\ngcc_register_toolchain(\n    name = \"gcc_toolchain_x86_64\",\n    target_arch = ARCHS.x86_64,\n)\n```\n\n## Documentation\n\n- **[Getting Started Guide](./docs/README.md)** - Setup, configuration, and advanced features.\n- **[API Reference](./docs/defs.md)** - Rule definitions and parameters.\n- **[Examples](./examples/README.md)** - Complete usage examples across languages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0rmiga%2Fgcc-toolchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff0rmiga%2Fgcc-toolchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0rmiga%2Fgcc-toolchain/lists"}