{"id":44052353,"url":"https://github.com/pulp-platform/riscv-gnu-toolchain","last_synced_at":"2026-02-07T23:36:16.626Z","repository":{"id":92130403,"uuid":"468454341","full_name":"pulp-platform/riscv-gnu-toolchain","owner":"pulp-platform","description":"GNU toolchain for PULP and RISC-V","archived":false,"fork":false,"pushed_at":"2025-03-15T10:07:11.000Z","size":991567,"stargazers_count":10,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-15T11:20:03.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"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/pulp-platform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-10T17:55:43.000Z","updated_at":"2025-03-15T10:07:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c508b29-ccf1-478f-b01c-4bcb6f8eb191","html_url":"https://github.com/pulp-platform/riscv-gnu-toolchain","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/pulp-platform/riscv-gnu-toolchain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulp-platform%2Friscv-gnu-toolchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulp-platform%2Friscv-gnu-toolchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulp-platform%2Friscv-gnu-toolchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulp-platform%2Friscv-gnu-toolchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pulp-platform","download_url":"https://codeload.github.com/pulp-platform/riscv-gnu-toolchain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulp-platform%2Friscv-gnu-toolchain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29212755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T23:36:15.537Z","status":"ssl_error","status_checked_at":"2026-02-07T23:36:12.879Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-02-07T23:36:15.980Z","updated_at":"2026-02-07T23:36:16.612Z","avatar_url":"https://github.com/pulp-platform.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"| 🧰 Toolchain | 🎯 Target extensions                            | 💻 Target cores | 🔗 Link                                                                                             |\n|--------------|------------------------------------------------|-----------------|-----------------------------------------------------------------------------------------------------|\n| **GCC11**    | **`xpulpv3`**                                  | **CV32E40P**    | **this repo**                                                                                       |\n| GCC7         | `xpulpv2`                                      | RI5CY           | [pulp-platform/pulp-riscv-gnu-toolchain](https://github.com/pulp-platform/pulp-riscv-gnu-toolchain) |\n| LLVM         | `xpulpv2`, `xssr`, `xfrep`, `xdma`, `xmempool` | RI5CY, Snitch   | [pulp-platform/llvm-project](https://github.com/pulp-platform/llvm-project)                         |\n\nPULP RISC-V GNU Compiler Toolchain\n=============================\n[![Build status](https://iis-git.ee.ethz.ch/gnu/riscv-gnu-toolchain/badges/master/pipeline.svg)](https://iis-git.ee.ethz.ch/gnu/riscv-gnu-toolchain/-/commits/master)\n\nThis is the PULP RISC-V C and C++ cross-compiler a generic ELF/Newlib toolchain.\n\n[[_TOC_]]\n\n###  Getting the sources\n\nThis repository uses submodules. You need the --recursive option to fetch the submodules automatically\n\n    $ git clone --recursive https://github.com/pulp-platform/riscv-gnu-toolchain.git\n\nAlternatively :\n\n    $ git clone https://github.com/pulp-platform/riscv-gnu-toolchain.git\n    $ cd riscv-gnu-toolchain\n    $ git submodule update --init --recursive\n    \n\n### Prerequisites\n\nSeveral standard packages are needed to build the toolchain.  On Ubuntu,\nexecuting the following command should suffice:\n\n    $ sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev\n\nOn Fedora/CentOS/RHEL OS, executing the following command should suffice:\n\n    $ sudo yum install autoconf automake python3 libmpc-devel mpfr-devel gmp-devel gawk  bison flex texinfo patchutils gcc gcc-c++ zlib-devel expat-devel\n\nOn OS X, you can use [Homebrew](http://brew.sh) to install the dependencies:\n\n    $ brew install python3 gawk gnu-sed gmp mpfr libmpc isl zlib expat\n\nTo build the glibc (Linux) on OS X, you will need to build within a\ncase-sensitive file system. The simplest approach is to create and mount a new\ndisk image with a case sensitive format. Make sure that the mount point does not\ncontain spaces. This is not necessary to build newlib or gcc itself on OS X.\n\nThis process will start by downloading about 200 MiB of upstream sources, then\nwill patch, build, and install the toolchain.  If a local cache of the\nupstream sources exists in $(DISTDIR), it will be used; the default location\nis /var/cache/distfiles.  Your computer will need about 8 GiB of disk space to\ncomplete the process.\n\n### Installation (Newlib)\n\nTo build the Newlib cross-compiler, pick an install path.  If you choose,\nsay, `/opt/riscv`, then add `/opt/riscv/bin` to your `PATH` now.  Then, simply\nrun the following command:\n\n    ./configure --prefix=/opt/riscv --with-arch=rv32imfcxpulpv3 --with-abi=ilp32 --enable-multilib\n    make\n\nYou should now be able to use riscv32-unknown-elf-gcc and its cousins. You can\nomit `--enable-multilib` if you are only interested in the specific\n`-march`/`-mabi` combination.\n\nSupported ABIs are ilp32 (32-bit soft-float), ilp32d (32-bit hard-float), ilp32f\n(32-bit with single-precision in registers and double in memory, niche use\nonly), and ilp32e (embedded abi, fewer caller-saved registers for better\ninterrupt latency)\n\n### Troubleshooting Build Problems\n\nBuilds work best if installing into an empty directory.  If you build a\nhard-float toolchain and then try to build a soft-float toolchain with\nthe same --prefix directory, then the build scripts may get confused\nand exit with a linker error complaining that hard float code can't be\nlinked with soft float code.  Removing the existing toolchain first, or\nusing a different prefix for the second build, avoids the problem.  It\nis OK to build one newlib and one linux toolchain with the same prefix.\nBut you should avoid building two newlib or two linux toolchains with\nthe same prefix.\n\nCentos (and RHEL) provide old GNU tools versions that may be too old to build\na RISC-V toolchain.  There is an alternate toolset provided that includes\ncurrent versions of the GNU tools.  This is the devtoolset provided as part\nof the Software Collection service.  For more info, see the\n[devtoolset-7](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/)\nURL.  There are various versions of the devtoolset that are available, so you\ncan also try other versions of it, but we have at least one report that\ndevtoolset-7 works.\n\n### Advanced Options\n\nThere are a number of additional options that may be passed to\nconfigure.  See './configure --help' for more details.\n\n### Running the Test Suite\n\nThe DejaGnu test suite has been ported to RISC-V.  This can run with GDB\nsimulator or QEMU.\nTo test GCC, run the following commands:\n\n    ./configure --prefix=$RISCV --with-arch=rv32ima\n\tmake report-gcc-newlib # or make report-gcc-newlib-qemu\n\tmake report-binutils-newlib\n\tmake report-gdb-newlib\n\n### Supported PULP Extensions\n\nRead [pulp.md](./pulp.md) for information about the supported PULP extensions. Read\n[core-v.rst](./core-v.rst) to see how these extension can be used with the cv32e40p.\n\n\nCheck `riscv32-unknown-elf-gcc --target=help` for supported options in the compiler,\n`riscv32-unknown-elf-gcc-as --help` for supported options in the assembler.\n\nIn the riscv-isa-manual you can check out how to write ISA strings that specify\nthe enabled extensions. In general, custom extension are denoted by a leading\n`x` followed the extension name. Extension are separated by and underscore `_`\nand you can also specify version numbers by appending a string `xpy` e.g. `2p0`\ndo specify version `2.0`. Here a few quick commands:\n\n* `riscv32-unknown-elf-gcc -march=rv32imfcxpulpv3 FILES`: rv32 with the `imfc`\n  standard extension and the `pulpv3` extension group.\n\n* `riscv32-unknown-elf-gcc -march=rv32imc_xpulphwloops_xpulppostmod FILES`: rv32 with\n  `imc` standard extension, pulp hardware loop and pulp load-store post modify\n  instructions.\n\nSometimes you want to run with an extension group such as `xpulpv3` but disable\ncertain subsets e.g. hardware loops. Do it like this:\n\n* `riscv32-unknown-elf-gcc -march=rv32imfc_xpulpv3 -mno-pulp-hwloop FILES`\n\nCheck `riscv32-unknown-elf-gcc --target=help` for more such switches.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulp-platform%2Friscv-gnu-toolchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulp-platform%2Friscv-gnu-toolchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulp-platform%2Friscv-gnu-toolchain/lists"}