-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode #71881
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
May 4, 2020
Thanks! This should really use |
📌 Commit 6e77729 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
May 4, 2020
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 5, 2020
Rollup of 10 pull requests Successful merges: - rust-lang#71587 (Report cannot move errors in promoted MIR) - rust-lang#71711 (Updates to some ignored tests) - rust-lang#71845 (Add const examples) - rust-lang#71878 (Add remove_current_as_list to LinkedList's CursorMut) - rust-lang#71881 (Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode) - rust-lang#71883 (add a missing "at" in a comment) - rust-lang#71891 (¬∃x. ¬y => ∀x. y) - rust-lang#71892 (Update btree_map::VacantEntry::insert docs to actually call insert) - rust-lang#71902 (Suggest to add missing feature when using gated const features) - rust-lang#71904 (fix typo in function name) Failed merges: r? @ghost
dvdhrm
added a commit
to dvdhrm/rust
that referenced
this pull request
Jun 2, 2020
Add a new codegen test which cross-compiles a UEFI program and verifies that an entry-point is emitted. The UEFI code-generation has broken in nightly before, see for instance: commit c1b2fd2 Merge: faccb0f 6e77729 Author: Dylan DPC <dylan.dpc@gmail.com> Date: Tue May 5 01:49:44 2020 +0200 Rollup merge of rust-lang#71881 - IsaacWoods:master, r=petrochenkov Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode This commit adds a very simple UEFI program and verifies that cross-compilation with the built-in `x86_64-unknown-uefi` target works. No runtime testing, nor any elaborate code-validation is done. This simply serves as base test that verifies compilation works and an entry point is emitted. Usually, you would use `libcore`, but in this test we do not want to trigger re-compilation of `libcore` for `x86_64-unknown-uefi`. Hence, we pull in just enough of `libcore` to make the test compile. This UEFI program is fully functional and returns success (i.e., 0). You can run it from your UEFI BootManager or from EfiShell. The imported UEFI definitions are explicitly kept simple. For more elaborate use-cases you would want the full UEFI specification (see the `r_efi` crate for a standalone import of the base UEFI specification).
ids1024
added a commit
to system76/firmware-setup
that referenced
this pull request
Oct 8, 2020
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.
jackpot51
pushed a commit
to system76/firmware-setup
that referenced
this pull request
Oct 16, 2020
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This handles UEFI handles when emitting inline assembly for sections containing LLVM bitcode. See details in #71880. I have locally confirmed that this change fixes compilation of projects using the
x86_64-unknown-uefi
target compiling withcargo-xbuild
, but I am not very familiar with LLVM bitcode so this may not be the correct approach.r? @alexcrichton as they wrote the initial LLVM bitcode emitting code?