Skip to content

rust-lang/rustc_codegen_c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6044b30 · Feb 26, 2025

History

12 Commits
Sep 25, 2024
Sep 25, 2024
Feb 26, 2025
Feb 26, 2025
Oct 27, 2024
Sep 25, 2024
Feb 26, 2025
Sep 25, 2024
Oct 8, 2024
Sep 29, 2024
Sep 29, 2024
Oct 27, 2024
Sep 25, 2024
Sep 25, 2024
Sep 25, 2024

rustc_codegen_c

C based backend for rustc

CI

This a C codegen backend for rustc, which lowers Rust MIR to C code and compiles it with a C compiler.

This code is still highly experimental and not ready for production use.

Try it

In the root directory of the project, run the following command:

./y rustc examples/basic_math.rs
./build/basic_math

The usage of ./y can be viewed from ./y help.

Note: only Linux is supported at the moment. clang is required to compile C code, and LLVM FileCheck is required to test the codegen.

License

This project is licensed under a dual license: MIT or Apache 2.0.