4.0 KiB
Contributing to rustc_codegen_gcc
Welcome to the rustc_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
For detailed setup instructions including dependencies, build steps, and initial testing, please refer to our README. The README contains the most up-to-date information on:
- Required dependencies and system packages
- Repository setup and configuration
- Build process
- Basic test verification
Once you've completed the setup process outlined in the README, you can proceed with the contributor-specific information below.
Communication Channels
- Matrix: Join our Matrix channel
- IRC: Join us on IRC
- GitHub Issues: For bug reports and feature discussions
We encourage new contributors to join our communication channels and introduce themselves. Feel free to ask questions about where to start or discuss potential contributions.
Understanding Core Concepts
Common Development Tasks
Running Specific Tests
To run specific tests, use appropriate flags such as:
./y.sh test --test-libcore
./y.sh test --std-tests
cargo test -- <name of test>
Additionally, you can run the tests of libgccjit
:
# 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
: Dumps the GIMPLE IRCG_RUSTFLAGS
: Additional Rust flagsCG_GCCJIT_DUMP_MODULE
: Dumps a specific moduleCG_GCCJIT_DUMP_TO_FILE
: Creates C-like representation
Full list of debugging options can be found in the README.
Making Contributions
Finding Issues to Work On
- Look for issues labeled with
good first issue
orhelp wanted
- Check the progress report for larger initiatives
- Consider improving documentation or investigating failing tests (except
failing-ui-tests12.txt
)
Pull Request Process
- Fork the repository and create a new branch
- Make your changes with clear commit messages
- Add tests for new functionality
- Update documentation as needed
- Submit a PR with a description of your changes
Code Style Guidelines
- Follow Rust standard coding conventions
- Ensure your code passes
rustfmt
andclippy
- Add comments explaining complex logic, especially in GCC interface code
Additional Resources
- Rustc Dev Guide
- GCC Internals Documentation
- Project-specific documentation in the
doc/
directory:
Getting Help
If you're stuck or unsure about anything:
- Check the existing documentation in the
doc/
directory - Ask in the IRC or Matrix channels
- Open a GitHub issue for technical problems
- 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.