-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade rust toolchain to nightly-2024-11-05 #585
base: main
Are you sure you want to change the base?
Conversation
@Patryk27, some CI jobs are failing with
is this still one of the known problems or something new? |
This is known, it’s already fixed in LLVM, but not yet backported - it should be in rustc within a couple days hopefully; I’ll let you know, so we can wait before bumping the toolchain here to get all of the fixes 🙂 |
@Rahix I think we should be good now - could you bump to the newest toolchain? 👀 |
@Patryk27, unfortunately it looks like we are still hitting the dreaded Just to check, I also tried |
Ouch, my fault! It seems that llvm/llvm-project#109124 wasn't backported - I'll handle it tomorrow. Other commits seem to be in place, though (e.g. #573 is fixed), so we're mostly ready 😄 |
No worries! Just ping me once the patch has hit nightly Rust, then I'll give it another shot :) Thanks for all your compiler work! |
Alright, let's try now - the appropriate fix should've gone with rust-lang/rust#132352. |
Updated to Is the fix maybe not actually in this version I tried? |
Could you try Either that or it's going to be a new kind of error, we'll see 😄 |
This allows us to see which targets are currently failing the build.
Updated to 2024-11-05, still same targets failing... So I guess this is a new thing then? 😅 |
Looks this way 😅 I'll try reproducing locally and report back. |
Status: reproduced!
... will crash, saying I've altered the error message in LLVM to print the offset it's trying to generate instruction for and it's pretty obvious something's off:
I'll try narrowing the issue down 🫡 |
Got it! Reduced: The issue boils down to too large jumps - basically, given: foo:
rjmp bar
# lots of code
bar:
# something ... if there's too many opcodes between To avoid this issue, LLVM has a pass called branch relaxation that detects too large jumps and upgrades them into different instructions - in the case of AVR, that's where the backend might decide to emit Everything's fine if the target AVR supports ... just to crash a moment later, in sort of a ¯_(ツ)_/¯ whaddya-want-me-to-do fashion. Fortunately, not all hope is lost! - there's two ways out of this situation:
We didn't have to worry about those offsets, because in the past - up until llvm/llvm-project@6859685 aka llvm/llvm-project#106722 - LLVM handled jumps by relying on relocations. Relocations allow to store larger offsets with the assumption that "the linker will somehow deal with them later", and it did: (most likely) by applying the wrapping trick. tl;dr linker smart, linker can solve "large jumps" issue - but llvm no longer rely on linker for jump, llvm must be taught to emit long jumps on its own I'll try preparing the patch in the upcoming days. |
Damn, nice work!
haha, i love it 😆 cursed, indeed |
Time for another toolchain upgrade to fix a number of known compiler bugs.