Progress Report #10: rustc_codegen_gcc can now bootstrap rustc!

What is rustc_codegen_gcc?

rustc_codegen_gcc is a GCC codegen for rustc, meaning that it can be loaded by the existing rustc frontend, but benefits from GCC by having more architectures supported and having access to GCC’s optimizations.

GCC patches status

No progress on the review of my GCC patches this month.

I did some work that will result in patches when they’re ready:

State of rustc_codegen_gcc

Here’s what has been done this month:

As you may have guessed from the title of this blog post, the GCC codegen has made enough progress to be able to compile rustc itself! That’s a huge milestone!

I was able to compile rustc using the GCC codegen and use the resulting rustc to compile a Hello World!

Thanks to bjorn3 who helped me a lot by testing the process of compiling rustc with the GCC codegen, reporting the errors encountered to me, helping me to fix some of those and answering my questions!

The SIMD work is not over, but a good part of it was done. I implemented enough of it to allow bootstrapping the compiler.

UI tests progress

Here are the results of running the UI tests in the CI:

Category Last Month This Month Delta

Passed

4542

4598

+56

Failed

49

64

+15

More tests are failing now because I enabled the tests for SIMD which were disabled before. Some other tests are disabled and I will enable them when I start working on the features they test.

For the next month, I’ll continue working on SIMD support and perhaps start working on unwinding support.

How to contribute

rustc_codegen_gcc

If you want to help on the project itself, please do the following:

  1. Run the tests locally.

  2. Choose a test that fails.

  3. Investigate why it fails.

  4. Fix the problem.

Even if you can’t fix the problem, your investigation could help, so if you enjoy staring at assembly code, have fun!

Crates and rustc

If you would like to contribute on adding support for Rust on currently unsupported platforms, you can help by adding the support for those platforms in some crates like libc and object and also in the rust compiler itself.

Test this project

Otherwise, you can test this project on new platforms and also compare the assembly with LLVM to see if some optimization is missing.

Good first issue

Finally, another good way to help is to look at good first issues. Those are issues that should be easier to start with.

Thanks for your support!

I wanted to personally thank all the people that sponsor this project: your support is very much appreciated.

A special thanks to the following sponsors:

  • saethlin

  • embark-studios

  • Traverse-Research

  • Thomas Colliers

  • Shnatsel

A big thank you to bjorn3 for his help, contributions and reviews. And a big thank you to lqd and GuillaumeGomez for answering my questions about rustc’s internals. Another big thank you to Commeownist for his contributions.

Also, a big thank you to the rest of my sponsors:

  • kpp

  • 0x7CFE

  • repi

  • nevi-me

  • oleid

  • acshi

  • joshtriplett

  • djc

  • TimNN

  • sdroege

  • pcn

  • alanfalloon

  • steven-joruk

  • davidlattimore

  • Nehliin

  • colelawrence

  • zmanian

  • alexkirsz

  • regiontog

  • berkus

  • wezm

  • belzael

  • vincentdephily

  • mexus

  • jam1garner

  • yvt

  • Shoeboxam

  • evanrichter

  • stuhood

  • yerke

  • bes

  • raymanfx

  • seanpianka

  • srijs

  • kkysen

  • messense

  • riking

  • rafaelcaricio

  • Lemmih

  • memoryruins

  • pthariensflame

  • senden9

  • Hofer-Julian

  • robjtede

  • Jonas Platte

  • spike grobstein

  • Oliver Marshall

  • Sam Harrington

  • Jonas

  • Jeff Muizelaar

  • Chris Butler

  • sierrafiveseven

  • Joseph Garvin

  • icewind

  • Sebastian Zivota

  • Oskar Nehlin

  • Nicolas Barbier

  • Daniel

  • Justin Ossevoort

  • sstadick

  • luizirber

  • kiyoshigawa

  • robinmoussu

  • Daniel Sheehan

and a few others who preferred to stay anonymous.