Skip to content

Commit 2fc138f

Browse files
committed
modify docs
1 parent 62978b3 commit 2fc138f

File tree

2 files changed

+58
-66
lines changed

2 files changed

+58
-66
lines changed

CONTRIBUTING.md

+30-51
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,19 @@
11
# Contributing to rust_codegen_gcc
22

3-
Welcome to the rust_codegen_gcc project! This guide will help you get started as a contributor. The project aims to provide a GCC codegen backend for rustc, allowing Rust compilation on platforms unsupported by LLVM and potentially improving runtime performance through GCC's optimizations.
3+
Welcome to the `rust_codegen_gcc` project! This guide will help you get started as a contributor. The project aims to provide a GCC codegen backend for rustc, allowing Rust compilation on platforms unsupported by LLVM and potentially improving runtime performance through GCC's optimizations.
44

55
## Getting Started
66

77
### Setting Up Your Development Environment
88

9-
1. Install the required dependencies:
10-
- rustup (follow instructions on the [official website](https://rustup.rs))
11-
- DejaGnu (for running libgccjit test suite)
12-
- Additional packages: `flex`, `libmpfr-dev`, `libgmp-dev`, `libmpc3`, `libmpc-dev`
9+
For detailed setup instructions including dependencies, build steps, and initial testing, please refer to our [README](https://github.com/rust-lang/rustc_codegen_gcc/blob/master/Readme.md). The README contains the most up-to-date information on:
1310

14-
2. Clone and configure the repository:
15-
```bash
16-
git clone https://github.com/rust-lang/rust_codegen_gcc
17-
cd rust_codegen_gcc
18-
cp config.example.toml config.toml
19-
```
11+
- Required dependencies and system packages
12+
- Repository setup and configuration
13+
- Build process
14+
- Basic test verification
2015

21-
3. Build the project:
22-
```bash
23-
./y.sh prepare # downloads and patches sysroot
24-
./y.sh build --sysroot --release
25-
```
26-
27-
### Running Tests
28-
29-
To verify your setup:
30-
```bash
31-
# Run the full test suite
32-
./y.sh test --release
33-
34-
# Test with a simple program
35-
./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
36-
```
16+
Once you've completed the setup process outlined in the README, you can proceed with the contributor-specific information below.
3717

3818
## Communication Channels
3919

@@ -45,40 +25,37 @@ We encourage new contributors to join our communication channels and introduce t
4525

4626
## Understanding Core Concepts
4727

48-
### Project Structure
49-
50-
The project consists of several key components:
51-
- The GCC backend integration through libgccjit
52-
- Rust compiler interface
53-
- Test infrastructure
54-
5528
### Common Development Tasks
5629

5730
#### Running Specific Tests
58-
To run a specific test:
59-
1. Individual test: `./y.sh test --test <test_name>`
60-
2. libgccjit tests:
61-
```bash
62-
cd gcc-build/gcc
63-
make check-jit
64-
# For a specific test:
65-
make check-jit RUNTESTFLAGS="-v -v -v jit.exp=jit.dg/test-asm.cc"
66-
```
31+
To run specific tests, use appropriate flags such as:
32+
- `./y.sh test --test-libcore`
33+
- `./y.sh test --std-tests`
34+
35+
Additional test running options:
36+
```bash
37+
# libgccjit tests
38+
cd gcc-build/gcc
39+
make check-jit
40+
# For a specific test:
41+
make check-jit RUNTESTFLAGS="-v -v -v jit.exp=jit.dg/test-asm.cc"
42+
```
6743

6844
#### Debugging Tools
6945
The project provides several environment variables for debugging:
46+
- `CG_GCCJIT_DUMP_GIMPLE`: Most commonly used debug dump
47+
- `CG_RUSTFLAGS`: Additional Rust compiler flags
7048
- `CG_GCCJIT_DUMP_MODULE`: Dumps a specific module
7149
- `CG_GCCJIT_DUMP_TO_FILE`: Creates C-like representation
72-
- `CG_GCCJIT_DUMP_RTL`: Shows Register Transfer Language output
7350

7451
Full list of debugging options can be found in the README.
7552

7653
## Making Contributions
7754

7855
### Finding Issues to Work On
7956
1. Look for issues labeled with `good-first-issue` or `help-wanted`
80-
2. Check the project roadmap for larger initiatives
81-
3. Consider improving documentation or tests
57+
2. Check the [progress report](https://blog.antoyo.xyz/rustc_codegen_gcc-progress-report-34#state_of_rustc_codegen_gcc) for larger initiatives
58+
3. Consider improving documentation or investigate [failing tests](https://github.com/rust-lang/rustc_codegen_gcc/tree/master/tests)(except failing-ui-tests12.txt)
8259

8360
### Pull Request Process
8461
1. Fork the repository and create a new branch
@@ -97,10 +74,12 @@ Full list of debugging options can be found in the README.
9774
- [Rustc Dev Guide](https://rustc-dev-guide.rust-lang.org/)
9875
- [GCC Internals Documentation](https://gcc.gnu.org/onlinedocs/gccint/)
9976
- Project-specific documentation in the `doc/` directory:
100-
- Common errors
101-
- Debugging GCC LTO
102-
- Git subtree sync
103-
- Sending patches to GCC
77+
- [Common errors](./doc/errors.md)
78+
- [Debugging GCC LTO](./doc/debugging-gcc-lto.md)
79+
- [Debugging libgccjit](./doc/debugging-libgccjit.md)
80+
- [Git subtree sync](./doc/subtree.md)
81+
- [List of useful commands](./doc/tips.md)
82+
- [Send a patch to GCC](./doc/sending-gcc-patch.md)
10483

10584
## Getting Help
10685

@@ -110,4 +89,4 @@ If you're stuck or unsure about anything:
11089
3. Open a GitHub issue for technical problems
11190
4. Comment on the issue you're working on if you need guidance
11291

113-
Remember that all contributions, including documentation improvements, bug reports, and feature requests, are valuable to the project.
92+
Remember that all contributions, including documentation improvements, bug reports, and feature requests, are valuable to the project.

Readme.md

+28-15
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,35 @@ This is a GCC codegen for rustc, which means it can be loaded by the existing ru
1212
The primary goal of this project is to be able to compile Rust code on platforms unsupported by LLVM.
1313
A secondary goal is to check if using the gcc backend will provide any run-time speed improvement for the programs compiled using rustc.
1414

15-
### Dependencies
16-
17-
**rustup:** Follow the instructions on the official [website](https://www.rust-lang.org/tools/install)
18-
19-
**DejaGnu:** Consider to install DejaGnu which is necessary for running the libgccjit test suite. [website](https://www.gnu.org/software/dejagnu/#downloading)
20-
21-
15+
## Getting Started
2216

23-
## Building
17+
Note: **This requires a patched libgccjit in order to work.
18+
You need to use my [fork of gcc](https://github.com/antoyo/gcc) which already includes these patches.**
2419

25-
**This requires a patched libgccjit in order to work.
26-
You need to use my [fork of gcc](https://github.com/rust-lang/gcc) which already includes these patches.**
27-
28-
```bash
29-
$ cp config.example.toml config.toml
30-
```
20+
### Dependencies
21+
- rustup: follow instructions on the [official website](https://rustup.rs)
22+
- consider to install DejaGnu which is necessary for running the libgccjit test suite. [website](https://www.gnu.org/software/dejagnu/#downloading)
23+
- additional packages: `flex`, `libmpfr-dev`, `libgmp-dev`, `libmpc3`, `libmpc-dev`
24+
25+
### Quick start
26+
1. Clone and configure the repository:
27+
```bash
28+
git clone https://github.com/rust-lang/rust_codegen_gcc
29+
cd rust_codegen_gcc
30+
cp config.example.toml config.toml
31+
```
32+
33+
2. Build and test:
34+
```bash
35+
./y.sh prepare # downloads and patches sysroot
36+
./y.sh build --sysroot --release
37+
38+
# Verify setup with a simple test
39+
./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
40+
41+
# Run full test suite (expect ~100 failing UI tests)
42+
./y.sh test --release
43+
```
3144

3245
If don't need to test GCC patches you wrote in our GCC fork, then the default configuration should
3346
be all you need. You can update the `rustc_codegen_gcc` without worrying about GCC.
@@ -40,7 +53,7 @@ to do a few more things.
4053
To build it (most of these instructions come from [here](https://gcc.gnu.org/onlinedocs/jit/internals/index.html), so don't hesitate to take a look there if you encounter an issue):
4154

4255
```bash
43-
$ git clone https://github.com/rust-lang/gcc
56+
$ git clone https://github.com/antoyo/gcc
4457
$ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev
4558
$ mkdir gcc-build gcc-install
4659
$ cd gcc-build

0 commit comments

Comments
 (0)