-
Notifications
You must be signed in to change notification settings - Fork 5
Build as a 'bin' crate, linking with rust-lld #14
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
Conversation
This eliminated the two awkward `ld` steps from the Makefile, and seems to produce a smaller `.efi`. It seems to work, based on quick testing in qemu. Using 'uefi' for target because apparently Rust cares: rust-lang/rust#71881 Some changes to the target specification here are from `rustc -Z unstable-options --print target-spec-json --target x86_64-unknown-uefi`. We probably want more of the settings from there, but most likely still need our own custom target to change some things.
Nice. I couldn't get this working last night when I tried to copy the
These aren't awkward. They're downright black magic. I'd be glad to see them gone.
But we should try to align to the target as close as possible. The target name should probably be updated too to better match the builtin target, for anything special core or compiler_builtins do. Something like |
Linkers are invariably black magic. But hopefully if we have Rust doing the linking for us, we only have to worry about a smaller subset of the arcana...
The standard Too bad Rust target specifications don't seem to support an
For ABI details, I suppose we want the same thing as ``x86_64-unknown-uefi`, assuming it's correct. I'm sure issues there can lead to some great bugs...
Sounds good. |
We're calling to/from C code (edk2), so I don't think we should be unwinding in the first place. Most of the other options that we specify that aren't in |
Apparently Rust has a working group for unwinding across FFI boundaries: https://github.com/rust-lang/project-ffi-unwind If we're not even testing it, we can probably expect unwinding isn't working quite how it should. (It's also worth noting that So using |
This is currently identical to the output of `rustc -Z unstable-options --print target-spec-json --target x86_64-unknown-uefi` except with changes to `pre-link-args`.
I've pushed an update using a |
Using the same target file as system76/firmware-setup#14 Builds, though I don't know how to properly test it.
Using the same target file as system76/firmware-setup#14 Builds, though I don't know how to properly test it.
Using the same target file as system76/firmware-setup#14 Builds, though I don't know how to properly test it.
Using the same target file as system76/firmware-setup#14 Builds, though I don't know how to properly test it.
This eliminated the two awkward
ld
steps from the Makefile, and seems to produce a smaller.efi
. It seems to work, based on quick testing in qemu.Using 'uefi' for target because apparently Rust cares: rust-lang/rust#71881
Some changes to the target specification here are from
rustc -Z unstable-options --print target-spec-json --target x86_64-unknown-uefi
. We probably want more of the settings from there, but most likely still need our own custom target to change some things.