rust-lang / rust-lang/rustc_codegen_gcc
AVR support
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.2k
- Forks
- 105
- Avg merge
- 8h 20m
- Merged PRs (30d)
- 14
Description
This is mainly motivated due to size issues when using LLVM when AVR is targeted.
I have partial support for it in my forks (gcc, gccjit.rs, rustc_codegen_gcc, but there are a few features needed and some issues to be addressed.
Features needed:
- Setting mode flags (
-m) in libgccjit.- Done in fork, yet to be sent and more switches could be added.
- Fixed-point types.
- Done in fork, yet to be sent.
- Specify that
sysrootshould only depend oncoreandallocfor AVR.
Issues to be fixed:
- Setting an MCU to an specific one, such as
atmega328p, fails with an error message.- Done in fork by commenting lines, but a better solution is needed.
-
$GCC_EXEC_PATHneeds to be set for it to pickdevice-specsat the correct location (lib/gcc/avr/<gcc version>).- Done in fork but is a bit of a kludge.
- Doubles have a width of 32 bits by default.
- Done in fork, yet to be sent.
- Volatiles loads and stores are not honored.
- As seen in #167.
- Related to #166.
- Fix sent to GCC jit ML.
- In some binaries sizes are bigger than LLVM as of now due to panicking code not being optimized.
- Should be tracked in a separate issue.
- Hex dumps using
avr-objcopy -O ihexare way bigger than C.- Could be related to the previous issue.
- Garbage is transmitted when writing to a serial device in a dev build, release builds are not affected.
- Should be tracked in a separate issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No project files or tests are named. Start by reviewing the linked AVR-support forks and the libgccjit and rustc_codegen_gcc changes, then narrow the checklist to one unchecked item, considering the related issues #166 and #167. Done means one focused AVR feature or fix is implemented and its behavior is validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100