Skip to content

Conversation

@phil-opp
Copy link
Member

@phil-opp phil-opp commented Mar 7, 2021

Don't use the lea instructions get addresses of non-addressable memory locations. Instead, use mov <reg>, offset <label> instructions, which are the equivalent to mov <reg>, label instructions in nasm.

I'm not sure why the lea worked before, but maybe LLVM used to optimize the leas to mov instructions. Either way, the LLVM version used by the latest Rust nightly doesn't like the lea instructions anymore.

This PR includes a lot of commits where I tried to fix the Windows CI, which currently fails because of a bug in QEMU. Unfortunately, I wasn't able to get it working, so I just hope for a new QEMU release now. For the meantime, I disabled the fail-fast property so that we at least don't cancel the macOS build when the Windows job fails. (I kept the debug commits in this PR in case so that I don't need to rember which approaches I tried the next time I debug this.)

Fixes rust-osdev/bootimage#73 and fixes phil-opp/blog_os#937

@phil-opp phil-opp enabled auto-merge March 7, 2021 13:29
@phil-opp phil-opp merged commit b859d58 into main Mar 7, 2021
@phil-opp phil-opp deleted the mov-offset branch March 7, 2021 13:43
@phil-opp
Copy link
Member Author

phil-opp commented Mar 7, 2021

Published as v0.9.15.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Got "relocation R_X86_64_16 out of range:" error in cargo bootimage Fails to link with rust-lld with an out of range error in latest Rust Nightly

2 participants