Skip to content

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