about summary refs log tree commit diff
diff options
context:
space:
mode:
authorg4titanx <g4titan1@gmail.com>2025-02-07 11:22:21 +0100
committerAntoni Boucher <bouanto@zoho.com>2025-04-29 17:59:56 -0400
commita5b947ba1cba06bbd08f4d5c83aac1dba1dd37ca (patch)
tree56b966c1cb557181c08d5b631b7c733ee30865af
parentce5a198239ff3f656e0e5bb0035b6fac306a461a (diff)
downloadrust-a5b947ba1cba06bbd08f4d5c83aac1dba1dd37ca.tar.gz
rust-a5b947ba1cba06bbd08f4d5c83aac1dba1dd37ca.zip
modify docs
-rw-r--r--CONTRIBUTING.md81
-rw-r--r--Readme.md43
2 files changed, 58 insertions, 66 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3bddb6ac63b..85ddb6c8f46 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,39 +1,19 @@
 # Contributing to rust_codegen_gcc
 
-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.
+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.
 
 ## Getting Started
 
 ### Setting Up Your Development Environment
 
-1. Install the required dependencies:
-   - rustup (follow instructions on the [official website](https://rustup.rs))
-   - DejaGnu (for running libgccjit test suite)
-   - Additional packages: `flex`, `libmpfr-dev`, `libgmp-dev`, `libmpc3`, `libmpc-dev`
+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:
 
-2. Clone and configure the repository:
-   ```bash
-   git clone https://github.com/rust-lang/rust_codegen_gcc
-   cd rust_codegen_gcc
-   cp config.example.toml config.toml
-   ```
+- Required dependencies and system packages
+- Repository setup and configuration
+- Build process
+- Basic test verification
 
-3. Build the project:
-   ```bash
-   ./y.sh prepare  # downloads and patches sysroot
-   ./y.sh build --sysroot --release
-   ```
-
-### Running Tests
-
-To verify your setup:
-```bash
-# Run the full test suite
-./y.sh test --release
-
-# Test with a simple program
-./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
-```
+Once you've completed the setup process outlined in the README, you can proceed with the contributor-specific information below.
 
 ## Communication Channels
 
@@ -45,31 +25,28 @@ We encourage new contributors to join our communication channels and introduce t
 
 ## Understanding Core Concepts
 
-### Project Structure
-
-The project consists of several key components:
-- The GCC backend integration through libgccjit
-- Rust compiler interface
-- Test infrastructure
-
 ### Common Development Tasks
 
 #### Running Specific Tests
-To run a specific test:
-1. Individual test: `./y.sh test --test <test_name>`
-2. libgccjit tests: 
-   ```bash
-   cd gcc-build/gcc
-   make check-jit
-   # For a specific test:
-   make check-jit RUNTESTFLAGS="-v -v -v jit.exp=jit.dg/test-asm.cc"
-   ```
+To run specific tests, use appropriate flags such as:
+- `./y.sh test --test-libcore`
+- `./y.sh test --std-tests`
+
+Additional test running options:
+```bash
+# libgccjit tests
+cd gcc-build/gcc
+make check-jit
+# For a specific test:
+make check-jit RUNTESTFLAGS="-v -v -v jit.exp=jit.dg/test-asm.cc"
+```
 
 #### Debugging Tools
 The project provides several environment variables for debugging:
+- `CG_GCCJIT_DUMP_GIMPLE`: Most commonly used debug dump
+- `CG_RUSTFLAGS`: Additional Rust compiler flags
 - `CG_GCCJIT_DUMP_MODULE`: Dumps a specific module
 - `CG_GCCJIT_DUMP_TO_FILE`: Creates C-like representation
-- `CG_GCCJIT_DUMP_RTL`: Shows Register Transfer Language output
 
 Full list of debugging options can be found in the README.
 
@@ -77,8 +54,8 @@ Full list of debugging options can be found in the README.
 
 ### Finding Issues to Work On
 1. Look for issues labeled with `good-first-issue` or `help-wanted`
-2. Check the project roadmap for larger initiatives
-3. Consider improving documentation or tests
+2. Check the [progress report](https://blog.antoyo.xyz/rustc_codegen_gcc-progress-report-34#state_of_rustc_codegen_gcc) for larger initiatives
+3. Consider improving documentation or investigate [failing tests](https://github.com/rust-lang/rustc_codegen_gcc/tree/master/tests)(except failing-ui-tests12.txt)
 
 ### Pull Request Process
 1. Fork the repository and create a new branch
@@ -97,10 +74,12 @@ Full list of debugging options can be found in the README.
 - [Rustc Dev Guide](https://rustc-dev-guide.rust-lang.org/)
 - [GCC Internals Documentation](https://gcc.gnu.org/onlinedocs/gccint/)
 - Project-specific documentation in the `doc/` directory:
-  - Common errors
-  - Debugging GCC LTO
-  - Git subtree sync
-  - Sending patches to GCC
+  - [Common errors](./doc/errors.md)
+  - [Debugging GCC LTO](./doc/debugging-gcc-lto.md)
+  - [Debugging libgccjit](./doc/debugging-libgccjit.md)
+  - [Git subtree sync](./doc/subtree.md)
+  - [List of useful commands](./doc/tips.md)
+  - [Send a patch to GCC](./doc/sending-gcc-patch.md)
 
 ## Getting Help
 
@@ -110,4 +89,4 @@ If you're stuck or unsure about anything:
 3. Open a GitHub issue for technical problems
 4. Comment on the issue you're working on if you need guidance
 
-Remember that all contributions, including documentation improvements, bug reports, and feature requests, are valuable to the project.
\ No newline at end of file
+Remember that all contributions, including documentation improvements, bug reports, and feature requests, are valuable to the project.
diff --git a/Readme.md b/Readme.md
index d0e4dbba6d3..89e7e24bd32 100644
--- a/Readme.md
+++ b/Readme.md
@@ -12,22 +12,35 @@ This is a GCC codegen for rustc, which means it can be loaded by the existing ru
 The primary goal of this project is to be able to compile Rust code on platforms unsupported by LLVM.
 A secondary goal is to check if using the gcc backend will provide any run-time speed improvement for the programs compiled using rustc.
 
-### Dependencies
-
-**rustup:** Follow the instructions on the official [website](https://www.rust-lang.org/tools/install)
-
-**DejaGnu:** Consider to install DejaGnu which is necessary for running the libgccjit test suite. [website](https://www.gnu.org/software/dejagnu/#downloading)
-
-
+## Getting Started
 
-## Building
+Note: **This requires a patched libgccjit in order to work.
+You need to use my [fork of gcc](https://github.com/antoyo/gcc) which already includes these patches.**
 
-**This requires a patched libgccjit in order to work.
-You need to use my [fork of gcc](https://github.com/rust-lang/gcc) which already includes these patches.**
-
-```bash
-$ cp config.example.toml config.toml
-```
+### Dependencies
+  - rustup: follow instructions on the [official website](https://rustup.rs)
+  - consider to install DejaGnu which is necessary for running the libgccjit test suite. [website](https://www.gnu.org/software/dejagnu/#downloading)
+  - additional packages: `flex`, `libmpfr-dev`, `libgmp-dev`, `libmpc3`, `libmpc-dev`
+  
+### Quick start
+1. Clone and configure the repository:
+   ```bash
+   git clone https://github.com/rust-lang/rust_codegen_gcc
+   cd rust_codegen_gcc
+   cp config.example.toml config.toml
+   ```
+
+2. Build and test:
+   ```bash
+   ./y.sh prepare  # downloads and patches sysroot
+   ./y.sh build --sysroot --release
+   
+   # Verify setup with a simple test
+   ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
+   
+   # Run full test suite (expect ~100 failing UI tests)
+   ./y.sh test --release
+   ```
 
 If don't need to test GCC patches you wrote in our GCC fork, then the default configuration should
 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.
 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):
 
 ```bash
-$ git clone https://github.com/rust-lang/gcc
+$ git clone https://github.com/antoyo/gcc
 $ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev
 $ mkdir gcc-build gcc-install
 $ cd gcc-build