yeah, ideally with the reduced Rust/Swift/Go and the corresponding reduced LLVM IR
Carl Peto
@carlos4242
True. It’s quite buggy. The thing I like is you are the only people I have on gitter. When I get a message on gitter I know it’s AVR rust related, focused and not “chatter”! :)
Wojciech Niedźwiedź
@Niedzwiedzw
hey
so I can use standard rust and compile for say arduino from now on?
Wojciech Niedźwiedź
@Niedzwiedzw
how do I load it onto the board? :D I have arduino uno
Should be a lot less niche now. We’ll see if a lot of folks get into it. Maybe you can post a video of you getting blink working. Like a simple howto. And tweet it to spread the word?
I'll have a blog post about it published in a little while, but that runs on yesterday's nightly just fine
Ayke
@aykevl
Unfortunately, https://reviews.llvm.org/D82536 is invalid. I've abandoned it to indicate the current state. However, it may be good enough for you when you replace STT_NOTYPE with STT_FUNC.
but I don't know how much it actually respects #[inline(never)]
Ayke
@aykevl
The set_high can still be inlined, for example
(I don't really know Rust but I'm assuming it works similar to C here)
Ben Schattinger
@lights0123
yeah but wouldn't that function boundary of test produce the same error?
Ayke
@aykevl
no, that's a direct call
Ben Schattinger
@lights0123
it's a call within a call?
Ayke
@aykevl
an indirect call is a function pointer, whenever you're storing a reference to a function and calling it elsewhere
closures are also a kind of function pointer (not sure whether Rust has them tbh)
Ben Schattinger
@lights0123
yeah it does have closures
Ok, I get it now—is there a problem with the VTable for Futures? I've totally skipped over Wakers for now and am just busy-loop polling.
Ayke
@aykevl
That's a bit out of my Rust knowledge, but normally a vtable is basically an array of function pointers that is usually stored as a global (for virtual functions in C++ for example). Calling a method from a vtable means doing an indirect call (as you're not directly calling the function, but loading the function address from the vtable and calling the function through that).
Again, the compiler will try to optimize the vtable away if possible, which may definitely happen in small programs
You could try looking at the disassembly, if you have any experience with that.
Ben Schattinger
@lights0123
Yep, I just ran into the same problem. When trying to clone a Waker, which calls a function defined in a manual VTable, my Arduino just crashes and doesn't respond.
Jake Goulding
@shepmaster
Yup. That’s because the relocation is invalid and you are jumping to the wrong place.
@aykevl maybe you could ping @dylanmckay for tips on where to look to emit the right assembly?
Jonah Dahlquist
@jonahbron
Hey I just saw that AVR-Rust has been upstreamed, super exciting!
I'm having trouble building though, issues with avr-gcc.
It seems like there avr-gcc flags being set that aren't supported by the one I have installed. Any ideas how to configure how avr-gcc gets called?