Skip to content

AVR support #406

@YakoYakoYokuYoku

Description

@YakoYakoYokuYoku

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.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions