Rahix / avr-hal-template

cargo-generate template for avr-hal projects
Apache License 2.0
130 stars 28 forks source link

Upgrade toolchain and disable LTO #9

Closed Patryk27 closed 2 years ago

Patryk27 commented 2 years ago

(commit messages contain rationale)

Rahix commented 2 years ago

Hey, completely missed to also leave a comment here. As you might have noticed, I have already pulled in the toolchain update commit here and in avr-hal. Thank you again for your persistent compiler work, you are bringing the AVR backend forward a great deal.

For the LTO change, I am unsure. From my experience, a lot of programs do not compile at all without LTO as a lot of libraries aren't annotated with #[inline] enough. I think even avr-hal might be an offender of this as it has been used with LTO almost exclusively up to now...

Patryk27 commented 2 years ago

Fair argument about the LTO - I suggested it mostly because people relatively frequently stumble upon that issue on internet (two times on r/rust already, IIRC) and it's peculiarly nasty, since it gives those "oh no, rust avr is broken again" vibes, when it's not even AVR's codegen fault 😓

But yeah, if from your experience disabing LTO makes things even worse, then maybe it's better to keep it enabled and focus on actually fixing the underlying issue :smile:

Rahix commented 2 years ago

I agree, the situation is a bit unfortunate...

I do wonder, does the workaround I posted in that issue not work for the cases where you're hitting it?

Patryk27 commented 2 years ago

Hmm, in which issue? 👀

Rahix commented 2 years ago

Here: https://github.com/rust-lang/compiler-builtins/issues/347#issuecomment-706403824

Patryk27 commented 2 years ago

Ah, I see! I haven't checked that one yet, I'll try the next time I face this error.

Patryk27 commented 2 years ago

Lemme close this one, to keep it tidy - I'll re-open in case I find anything :-)