Skip to content

AVR support #3

Closed
Closed

Description

@japaric

Parent issue: #2

Next steps:

See also avr-rust/rust for out of tree work towards AVR support in Rust.

Activity

  1. dylanmckay commented on Oct 12, 2016

    @dylanmckay
    Contributor

    Here's an email I sent out to the llvm-dev list very recently regarding the status of the AVR backend.

    tl;dr there's really only 3 files needed before the backend will be 80% usable.

  2. japaric commented on Nov 1, 2016

    @japaric
    MemberAuthor

    Hey, @dylanmckay. I'm wondering what's the current status. I saw that there's only one "PR" (differential revision) in the review queue and that it has already been accepted but has not landed yet.

    After that lands, will LLVM be ready to compile Rust programs for AVR? Will you (and @shepmaster) be sending a PR updating Rust's LLVM next?

    Happy to help with anything to land this in rust-lang/rust. 😄 (I should finish landing my PR that moves rust-lang/rust to the WIP Rust port of compiler-rt intrinsics; I suspect that it may help here)

  3. shepmaster commented on Nov 1, 2016

    @shepmaster

    a PR updating Rust's LLVM next?

    Eventually, yeah, except the LLVM 4.0 changes are more annoying than any previous LLVM changes I've had to make.

    moves rust-lang/rust to the WIP Rust port of compiler-rt intrinsics

    I think it will help. Especially because one "bug" we have at the moment is that I've forgotten to publish the WIP branch of compiler-rt so people are getting build failures.

  4. japaric commented on Nov 1, 2016

    @japaric
    MemberAuthor

    Eventually, yeah

    I'm really looking forward to LLVM 4.0 in rust-lang/rust so if you make it happen you'll have my gratitude.

    the WIP branch of compiler-rt

    Did you have to implement new intrinsics? I only see build system related changes in your fork.

  5. shepmaster commented on Nov 1, 2016

    @shepmaster

    I'm really looking forward to LLVM 4.0

    What benefits do you expect to see from it?

    implement new intrinsics

    I think we might have to, but haven't yet.

  6. japaric commented on Nov 1, 2016

    @japaric
    MemberAuthor

    What benefits do you expect to see from it?

    I'm working on embedding lld, the LLVM linker, into rustc and having LLVM 4.0 lets me use the latest lld release which has better linker script support. (Linker script support in lld 3.9 is minimal) I'm hoping that someday I'll be able to build Rust programs for Cortex M devices without having to install arm-none-eabi-gcc first.

  7. dylanmckay commented on Nov 2, 2016

    @dylanmckay
    Contributor

    I saw that there's only one "PR" (differential revision) in the review queue and that it has already been accepted but has not landed yet.

    I'm about to commit that one now :)

    After that lands, will LLVM be ready to compile Rust programs for AVR? Will you (and @shepmaster) be sending a PR updating Rust's LLVM next?

    It should be able to compile very trivial instructions. There are two source files that will fix that.

    • AVRBranchSelector - The branch relaxation pass (which will be rewritten to use the generic relaxation pass before it is merged)
    • AVRExpandPseudoInsts - This is required for basically any 16-bit operation (hint: almost everything). I've put this one off until last because we can compile really basic examples without it. On top of that is that it is essentially a 2000 line hack full of code duplication.
  8. raphaelcohn commented on Nov 5, 2016

    @raphaelcohn

    @japaric Big shout out for lld embedded into rustc. It's not an easy thing to do - I know I'd struggle - but a rust toolchain that's entirely independent of GNU binutils and gcc is an enormous win for rust.

  9. japaric commented on Nov 5, 2016

    @japaric
    MemberAuthor

    @raphaelcohn Check rust-lang/rust#36120. It's pretty much already working on Linux and it can link Cortex-M programs without arm-none-eabi-gcc. It hasn't landed because I couldn't get lld to build properly on Windows 😞

    a rust toolchain that's entirely independent of GNU binutils and gcc is an enormous win for rust.

    Indeed! If all goes well we'll also be able to (cross) compile statically linked MUSL binaries without needing glibc installed on the system as well. Ahh, the dream of the "zero installation steps" cross compilation setup may soon come true.

  10. dylanmckay commented on Nov 8, 2016

    @dylanmckay
    Contributor
    • The machine code test suite is now fully passing and currently in review (D26387)
    • About half of the code generation tests are fully passing and are also currently in review (D26388)
  11. 12 remaining items

  12. dylanmckay commented on Feb 27, 2018

    @dylanmckay
    Contributor

    @japaric good catch, that's my mistake.

    I wonder if it worked for me because it always evaluated to true. Easy to replace with #[cfg(target_arch)] though.

  13. removed this from the 2018 edition milestone on Jul 27, 2018
  14. japaric commented on Aug 2, 2018

    @japaric
    MemberAuthor

    @dylanmckay rustc moved to LLVM 7 a few weeks ago. I believe the last upgrade to LLVM 6 ended up increasing the number of codegen bugs encountered when building core. Was wondering if you had a chance to check if moving to LLVM 7 improved things or made them worse?

  15. brainlag commented on Aug 7, 2018

    @brainlag
  16. shepmaster commented on Nov 14, 2018

    @shepmaster

    FWIW, we moved to LLVM 8 recently, thanks to @TimNN. We've been able to compile the entire core library (probably not using all of it though), removing the need for our special hacked libcore.

  17. ZhangHanDong commented on Dec 17, 2018

    @ZhangHanDong

    One of the Rust 2019 Wish lists

  18. dylanmckay commented on Dec 19, 2018

    @dylanmckay
    Contributor

    I've updated the checklist for merge in the description and raised #282 to track performing a Crater run against AVR.

  19. jplatte commented on Dec 19, 2018

    @jplatte

    @dylanmckay I think you meant #282 ;)

  20. dylanmckay commented on Dec 19, 2018

    @dylanmckay
    Contributor

    Whoops, is it still a ninja edit 25 minutes later? 🤔

  21. eldruin commented on Aug 11, 2020

    @eldruin
    Member

    AVR support was merged into Rustc. Can this be closed now?

  22. therealprof commented on Aug 11, 2020

    @therealprof
    Contributor

    Yes, let's close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions