rust-lang / rust-lang/rustc_codegen_gcc

AVR support

Open
#406 17 comments 2 reactions 0 assignees View on GitHub

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 sysroot should only depend on core and alloc for 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_PATH needs to be set for it to pick device-specs at 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 ihex are 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.