Thanks again to Open Source Security, inc and Embecosm for their ongoing support for this project.
The project merged 102 PRs merged in the last months, which is
impressive considering the amount of travel that the team did to attend
various conferences. We have made substantial progress on intrinsics,
which are now complete minus a few volatile_* intrinsics that Zhi
Heng is currently implementing. All of
the missing intrinsics were added this months, which amounts to a total
of 107 intrinsics implemented in the last few weeks. This affects our
compilation of core as it relies on these intrinsics being present,
but most importantly on them being accurate to the version that
rustc emits. In some cases, it is not possible to reproduce the exact
behavior of the intrinsic with GCC as opposed to LLVM, but these cases
are exclusively for performance considerations - we have strived to make
the underlying behavior of every intrinsic the exact same under gccrs.
For example, a intrinsics::nontemporal_store<T> is equivalent to a
intrinsics::move_val_init<T> but with an extra marker to indicate to
the backend that this data should not be held in cache. It is currently
impossible to add this “marker” from a GCC frontend, so we simply emit
the same code as a move_val_init when generating this intrinsic.
Likewise, GCC’s __builtin_prefetch() does not allow prefetching from
the instruction cache, as opposed to LLVM’s llvm.prefetch intrinsic.
We thus… don’t prefetch instructions for
prefetch_{write, read}_instruction<T>, which again only affects the
performance of the produced binary, but not its behavior.
This month also saw a lot of work on external crate handling, with
Pierre-Emmanuel making great progress on name resolving paths from
external crates. We could not handle modules defined within external
crates, and could not resolve global paths from other crates. Fixing
this highlighted a slew of other issues and thus took a long time. We
introduced a new testsuite focused on multi-crates testing to ensure we
won’t introduce further regressions. We are also picking up the
typechecking work and going through the last few remaining bugs with
recursive types and slice intrinsics. These are the only few hurdles
remaining before a full compilation of core.
On the side, we have also started experimenting with the BPF backend for
GCC using gccrs. We are currently modifying the code from the SCX
REEVDF scheduler (https://github.com/sched-ext/scx/) in order to get
it to compile with gccrs. These projects are interesting, as they do
not depend on the standard library, and are thus a perfect target for
gccrs. We still need to tweak them a little as they are written in a
more recent version of Rust than what gccrs is currently targeting,
and thus make use of unsupported Rust language features such as if-let
chains.
Our time in conferences during the last two months went extremely well,
with a lot of interest in gccrs at RustConf, EuroRust, Kangrejos and
Cauldron. We also gave a talk about the progress of the project at the
Linux Plumbers Conference.
For now, only the recording of the RustConf talk is available: https://www.youtube.com/watch?v=GzxLOCigy60
We will be posting the other recordings as soon as we have them!
During the month of November, we plan on continuing the work on the
typechecker and on the backend. We also want to start implementing
CoercePointee properly, as it is an essential feature for the
low-level alloc crate of the Linux kernel.
| Category | Last Month | This Month | Delta |
|---|---|---|---|
| TODO | 434 | 421 | -13 |
| In Progress | 118 | 123 | +5 |
| Completed | 1328 | 1404 | +82 |
| Category | Last Month | This Month | Delta |
|---|---|---|---|
| TODO | 204 | 198 | -6 |
| In Progress | 51 | 52 | -1 |
| Completed | 647 | 661 | +14 |
| TestCases | Last Month | This Month | Delta |
|---|---|---|---|
| Passing | 11549 | 11951 | +402 |
| Failed | - | - | - |
| XFAIL | 87 | 86 | -1 |
| XPASS | - | - | - |
Here is the list of overarching milestones gccrs is currently targeting. We’ll use the acronym in the following milestone tables, in the column named “OA Milest.”.
| Milestone | Description | Acronym |
|---|---|---|
| Embedded Rust 1.49 compiler 0.1 | The compiler is able to compile embedded Rust code | EC 0.1 |
| Embedded Rust 1.49 compiler 1.0 | The compiler is able to compile embedded Rust code and produce valid executables | EC 1.0 |
| Rust-for-Linux compiler 0.1 | The compiler is able to compile the Linux kernel | LC 0.1 |
| Rust-for-Linux compiler 1.0 | The compiler is able to compile the Linux kernel and produce a runnable kernel | LC 1.0 |
| General purpose Rust 1.49 compiler | The compiler passes the Rust 1.49 testsuite, and handles general purpose code | GC |
| Milestone | Last Month | This Month | Delta | Start Date | Completion Date | Target | OA Milest. |
|---|---|---|---|---|---|---|---|
| Rust-for-Linux | 55% | 60% | +5% | 1st Nov 2025 | - | - | LC 0.1 |
| Full core Late nameres issues | 100% | 100% | - | 1st Dec 2025 | - | - | EC 0.1 |
| Full core Early nameres issues | 100% | 100% | - | 1st Dec 2025 | - | - | EC 0.1 |
| Full core Lowering issues | 100% | 100% | - | 3rd Aug 2026 | 17 Aug 2026 | 17 Aug 2026 | EC 0.1 |
| Typechecking fixes core 1.49 | 60% | 80% | +20% | 3rd Aug 2026 | - | - | EC 0.1 |
| Backend fixes core 1.49 | 0% | 45% | +45% | 3rd Aug 2026 | - | - | EC 0.1 |
| RfL builderror | 100% | 100% | - | - | - | - | LC 0.1 |
| RfL compilerbuiltins | 100% | 100% | - | - | - | - | LC 0.1 |
| RfL ffi | 40% | 40% | - | - | - | - | LC 0.1 |
| RfL macros | 0% | 0% | - | - | - | - | LC 0.1 |
| RfL uapi | 0% | 0% | - | - | - | - | LC 0.1 |
| RfL main kernel files | 0% | 0% | - | - | - | - | LC 0.1 |
| Upcoming Milestone | Last Month | This Month | Delta | Start Date | Completion Date | Target | OA Milest. |
|---|---|---|---|---|---|---|---|
| Unstable RfL features | 0% | 0% | - | 7th Jan 2025 | - | 1st Aug 2025 | LC 0.1 |
| Generic Associated Types | 0% | 0% | - | 15th Mar 2025 | - | 15th Jun 2025 | LC 0.1 |
| RfL const generics | 0% | 0% | - | 1st May 2025 | - | 15th Jun 2025 | LC 0.1 |
| frontend plugin hooks | 0% | 0% | - | 15th May 2025 | - | 7th Jul 2025 | GC |
| Handling the testsuite issues | 0% | 0% | - | 15th Sep 2024 | - | 15th Sep 2025 | GC |
| main shim | 0% | 0% | - | 28th Jul 2025 | - | 15th Sep 2025 | GC |
| Final core attributes | 0% | 0% | - | - | EC 0.1 | ||
| Core nightly features | 0% | 0% | - | - | EC 0.1 | ||
| Defered inference | 0% | 0% | - | - | EC 0.1 | ||
| Fn traits fixes | 0% | 0% | - | - | EC 0.1 | ||
| Recursive types | 0% | 0% | - | - | EC 0.1 | ||
| Drop | 0% | 0% | - | - | EC 1.0 | ||
| Pin, PinInit | 0% | 0% | - | - | EC 1.0 |
| Past Milestone | Last Month | This Month | Delta | Start Date | Completion Date | Target | Target GCC |
|---|---|---|---|---|---|---|---|
| Data Structures 1 - Core | 100% | 100% | - | 30th Nov 2020 | 27th Jan 2021 | 29th Jan 2021 | GCC 14.1 |
| Control Flow 1 - Core | 100% | 100% | - | 28th Jan 2021 | 10th Feb 2021 | 26th Feb 2021 | GCC 14.1 |
| Data Structures 2 - Generics | 100% | 100% | - | 11th Feb 2021 | 14th May 2021 | 28th May 2021 | GCC 14.1 |
| Data Structures 3 - Traits | 100% | 100% | - | 20th May 2021 | 17th Sep 2021 | 27th Aug 2021 | GCC 14.1 |
| Control Flow 2 - Pattern Matching | 100% | 100% | - | 20th Sep 2021 | 9th Dec 2021 | 29th Nov 2021 | GCC 14.1 |
| Macros and cfg expansion | 100% | 100% | - | 1st Dec 2021 | 31st Mar 2022 | 28th Mar 2022 | GCC 14.1 |
| Imports and Visibility | 100% | 100% | - | 29th Mar 2022 | 13th Jul 2022 | 27th May 2022 | GCC 14.1 |
| Const Generics | 100% | 100% | - | 30th May 2022 | 10th Oct 2022 | 17th Oct 2022 | GCC 14.1 |
| Initial upstream patches | 100% | 100% | - | 10th Oct 2022 | 13th Nov 2022 | 13th Nov 2022 | GCC 14.1 |
| Upstream initial patchset | 100% | 100% | - | 13th Nov 2022 | 13th Dec 2022 | 19th Dec 2022 | GCC 14.1 |
| Update GCC’s master branch | 100% | 100% | - | 1st Jan 2023 | 21st Feb 2023 | 3rd Mar 2023 | GCC 14.1 |
| Final set of upstream patches | 100% | 100% | - | 16th Nov 2022 | 1st May 2023 | 30th Apr 2023 | GCC 14.1 |
| Borrow Checking 1 | 100% | 100% | - | TBD | 8th Jan 2024 | 15th Aug 2023 | GCC 14.1 |
| Procedural Macros 1 | 100% | 100% | - | 13th Apr 2023 | 6th Aug 2023 | 6th Aug 2023 | GCC 14.1 |
| GCC 13.2 Release | 100% | 100% | - | 13th Apr 2023 | 22nd Jul 2023 | 15th Jul 2023 | GCC 14.1 |
| GCC 14 Stage 3 | 100% | 100% | - | 1st Sep 2023 | 20th Sep 2023 | 1st Nov 2023 | GCC 14.1 |
| GCC 14.1 Release | 100% | 100% | - | 2nd Jan 2024 | 2nd Jun 2024 | 15th Apr 2024 | GCC 14.1 |
| formatargs!() support | 100% | 100% | - | 15th Feb 2024 | - | 1st Apr 2024 | GCC 14.1 |
| GCC 14.2 | 100% | 100% | - | 7th Jun 2024 | 15th Jun 2024 | 15th Jun 2024 | GCC 14.2 |
| GCC 15.1 | 100% | 100% | - | 21st Jun 2024 | 31st Jun 2024 | 1st Jul 2024 | GCC 15.1 |
| Unhandled attributes | 100% | 100% | - | 1st Jul 2024 | 15th Aug 2024 | 15th Aug 2024 | GCC 15.1 |
| Inline assembly | 100% | 100% | - | 1st Jun 2024 | 26th Aug 2024 | 15th Sep 2024 | GCC 15.1 |
| Rustc Testsuite Adaptor | 100% | 100% | - | 1st Jun 2024 | 26th Aug 2024 | 15th Sep 2024 | GCC 15.1 |
| Borrow checker improvements | 100% | 100% | - | 1st Jun 2024 | 26th Aug 2024 | 15th Sep 2024 | GCC 15.1 |
| Deref and DerefMut improvements | 100% | 100% | - | 28th Sep 2024 | 25th Oct 2024 | 28th Dec 2024 | GCC 15.1 |
| Indexing fixes | 100% | 100% | - | 21st Jul 2024 | 25th Dec 2024 | 15th Nov 2024 | GCC 15.1 |
| Iterator fixes | 100% | 100% | - | 21st Jul 2024 | 25th Dec 2024 | 15th Nov 2024 | GCC 15.1 |
| Auto traits improvements | 100% | 100% | - | 15th Sep 2024 | 20th Jan 2025 | 21st Dec 2024 | GCC 15.1 |
| Lang items | 100% | 100% | - | 1st Jul 2024 | 10th Jan 2025 | 21st Nov 2024 | GCC 15.1 |
| alloc parser issues | 100% | 100% | - | 7th Jan 2025 | 31st Jun 2024 | 28th Jan 2025 | GCC 15.1 |
| std parser issues | 100% | 100% | - | 7th Jan 2025 | 31st Jun 2024 | 28th Jan 2025 | GCC 16.1 |
| Question mark operator | 100% | 100% | - | 15th Dec 2024 | 21st Feb 2025 | 21st Feb 2025 | GCC 15.1 |
| Name resolution 2.0 rework | 100% | 100% | - | 1st Jun 2024 | - | 1st Apr 2025 | GCC 15.1 |
| Macro expansion | 100% | 100% | - | 1st Jun 2024 | - | 1st Jan 2025 | GCC 15.1 |
| Remaining typecheck issues | 100% | 100% | - | 21st Oct 2024 | - | 1st Mar 2025 | GCC 15.1 |
| cfg-core | 100% | 100% | - | 1st Dec 2024 | 24th Mar 2025 | 1st Mar 2025 | GCC 15.1 |
| Codegen fixes | 100% | 100% | - | 7th Oct 2024 | 1st Apr 2025 | 1st Mar 2025 | GCC 15.1 |
| blackbox intrinsic | 100% | 100% | - | 28th Oct 2024 | - | 28th Jan 2025 | GCC 15.1 |
| let-else | 100% | 100% | - | 28th Jan 2025 | - | 28th Feb 2025 | GCC 15.1 |
| Specialization | 100% | 100% | - | 1st Jan 2025 | 1st Apr 2025 | 1st Mar 2025 | GCC 15.1 |
| cfg-rfl | 100% | 100% | - | 7th Jan 2025 | 19th Mar 2025 | 15th Feb 2025 | GCC 15.1 |
| Downgrade to Rust 1.49 | 100% | 100% | - | 14th Mar 2025 | 26th Mar 2025 | 1st Apr 2025 | GCC 15.1 |
| try blocks | 100% | 100% | - | 30th Jul 2025 | GCC 16.1 | ||
| while-let loops | 100% | 100% | - | 30th Jul 2025 | GCC 16.1 | ||
| offsetof!() builtin macro | 100% | 100% | - | 15th Mar 2025 | 4th Aug 2025 | 15th Aug 2025 | GCC 16.1 |
| Explicit generics with impl Trait | 100% | 100% | - | 28th Feb 2025 | 21st Jul 2025 | 28th Mar 2025 | GCC 16.1 |
| Final Inline assembly fixes | 100% | 100% | - | - | GCC 16.1 |