Skip to content

Skip assembly implementations on the UEFI targets #504

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

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

nicholasbishop
Copy link
Contributor

The UEFI targets link with /SAFESEH. That requires that objects have a symbol called @feat.00. Clang adds that symbol for COFF targets if the input is a C file, but not if the input is an ASM file. That doesn't prevent compiler_builtins or rustc from building, but using the resulting rustc to compile something that references one of the objects lacking @feat.00 will result in a linker error.

Fix by removing all the .S implementations when target_os == uefi.

This is a partial fix for rust-lang/rust#104326

The UEFI targets link with `/SAFESEH`. That requires that objects have a
symbol called [`@feat.00`]. Clang adds that symbol for COFF targets if
the input is a C file, but not if the input is an ASM file. That doesn't
prevent compiler_builtins or rustc from building, but using the
resulting rustc to compile something that references one of the objects
lacking `@feat.00` will result in a linker error.

Fix by removing all the `.S` implementations when `target_os == uefi`.

[`@feat.00`]: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#the-sxdata-section
@Amanieu Amanieu merged commit 8399451 into rust-lang:master Nov 16, 2022
@Amanieu
Copy link
Member

Amanieu commented Nov 16, 2022

Sounds good! I hope this can be reverted once rust-lang/cc-rs#751 is resolved.

@nicholasbishop nicholasbishop deleted the bishop-no-uefi-asm branch November 16, 2022 19:10
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.

2 participants