In GCC they approved the implementation of RUST (gccrs)

Recently the news broke that the GCC Steering Committee has approved the inclusion of the gccrs implementation (GCC Rust) from the Rust compiler in the GCC core.

With that GCC (GNU Compiler Collection) already have a backend for Rust, through the project called rustc_codegen_gcc founded by Antoni Boucher. It is still described as a work in progress, but it was merged into the main Rust repository in September 2021.

For those who do not know the language rust, they should know what ise focuses on secure memory management and provides the means to achieve high job parallelism. Safe memory handling, which excludes errors such as accessing a memory area after freeing it, dereferencing null pointers, and buffer bounds overflow, is achieved in Rust at compile time through checking for references, tracking object ownership, accounting for the lifetime of objects (scopes), and evaluating the correctness of memory access during code execution.

Rust also provides integer overflow protection, requires variables to be initialized before use, better handles errors in the standard library, enforces the concept of references and immutable variables by default.

After integrating the interface, in standard GCC it can be used to compile Rust programs without the need to install the rustc compiler built with LLVM builds.

Since November 2020, I have been working full time on the Rust front-end for GCC, thanks to Open Source Security, Inc and Embecosm. As a result, I'm writing to this mailing list to seek feedback from the collective experience here early to plan a path to uploading the front-end to GCC.

The importance of this project is its importance to Linux, generally built with GCC, where plans to allow Rust to be used alongside C for kernel code, for memory safety reasons, are constantly moving forward.

This means that the Rust compiler, rustc, can be used with the GCC backend, The backend being the code generator that supports more CPU architectures than LLVM, Rust's usual backend compiler, though there are limitations, such as requiring a patched version of GCC.

The alternative is to have a full GCC toolchain. In January 2021, Open Source Security, Inc, makers of a hardened version of the Linux kernel called Grsecurity, said it would fund a "public development effort" of a GCC interface for Rust, on the grounds that it improved security. by not having to mix different compilers.

From my perspective as a leader in this front-end, we are currently under heavy development so this means a fair amount of code rotating yet, and I don't see this changing until we can successfully compile the libcore box later this year. Though I'd love to see each other merged into GCC 13, I want to make sure this project is a success for all, and this could mean rolling back to the next release window to make sure this is manageable to produce a quality front-end to sit together to others.

The company cited a paper showing "how the overall security of a runtime environment can be reduced by introducing code written in Rust or another language where the compiler doesn't provide the same binary-level security."

gccrs developers are encouraged to start working with review teams and GCC Change Release to finalize and approve patches in terms of meeting the technical requirements for code to be added to GCC.

Assuming that gccrs development continues as planned and no unforeseen issues are identified, the Rust language front-end will be integrated into the GCC 13 release scheduled for May next year. The Rust implementation in GCC 13 will be in beta status, not yet enabled by default.

Finally if you are interested in knowing more about it about the project, you can consult the details in the following link.


A comment, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   qtrit said

    Great, I hope the implementation will be useful for many programmers.