# gcc-riscv32-pico-elf

Debian package for GCC, with appropriate configuration for building RISC-V software for RP2xxx MCUs.

Provenance of patches under [debian/local-patches](debian/local-patches):

* `0001-zibi.patch`: Zibi patch from Kito Cheng (upstream RISC-V GCC maintainer, likely to be merged upstream once this extension is ratified.)
* `0002-mcpu-hazard3.patch`: our local patch to add minimal (`-mcpu` and generic `-mtune`) support for Hazard3 versions that exist on RP chips.
* `0003-Fix-for-upstream-bug-stop-cm.popretz-walkback-when-a.patch` -- fix for [this upstream bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126454) which affects MicroPython, to be removed once that bug is fixed upstream. From Luke's fork.
* Others: fleshed out Hazard3 instruction support, and a few generic codegen improvements for embedded targets. The commits are from [Luke's GitHub GCC fork](https://github.com/wren6991/gcc).
	* Generally these are extracted directly with `git format-patch` from a GCC version as close as possible to the one pinned in this repository.
	* They're developed against a clean GCC release source tree, *without Debian distro patches*, so some of them have had local edits applied to fix conflicts.
	* I try to keep these patches rebased in an order where *later patches can be dropped* without losing functionality from earlier patches.

The GCC build configuration (e.g. correct default ISA, correct multilib setup) is configured directly in [debian/rules](debian/rules).

## Other Readmes

* [debian/README.Debian](debian/README.Debian)
* [debian/README.source](debian/README.source)
