Fix linking on i686 MSVC when using bare linkers#242
Merged
Shnatsel merged 1 commit intorust-secure-code:masterfrom Mar 4, 2026
Merged
Fix linking on i686 MSVC when using bare linkers#242Shnatsel merged 1 commit intorust-secure-code:masterfrom
Shnatsel merged 1 commit intorust-secure-code:masterfrom
Conversation
Shnatsel
reviewed
Mar 4, 2026
Comment on lines
+198
to
+211
| let mut feature: u64 = 0; | ||
| if architecture == Architecture::I386 { | ||
| feature |= 1; // IMAGE_FILE_SAFE_EXCEPTION_HANDLER | ||
| } | ||
| file.add_symbol(Symbol { | ||
| name: b"@feat.00".to_vec(), | ||
| value: feature, | ||
| size: 0, | ||
| kind: SymbolKind::Data, | ||
| scope: SymbolScope::Compilation, | ||
| weak: false, | ||
| section: SymbolSection::Absolute, | ||
| flags: SymbolFlags::None, | ||
| }); |
Member
There was a problem hiding this comment.
I don't really know much about the implications of some fields, such as the file.add_symbol call and all its arguments. Is this referenced from somewhere? It would be nice to have a comment explaining this.
Contributor
Author
There was a problem hiding this comment.
Indeed the relevant reference is https://github.com/rust-lang/rust/blob/b90dc1e597db0bbc0cab0eccb39747b1a9d7e607/compiler/rustc_codegen_ssa/src/back/metadata.rs#L224-L252
I'll add a link in a comment.
Closed
Member
Contributor
Author
|
I'm happy to make more changes but also feel free to push any further tweaks to the commentary directly. |
Member
|
Thanks! I'll take another look later today and hopefully publish a release with the fix by tomorrow. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I encountered the following failure downstream here when building for
i686-pc-windows-msvcI then used an LLM to debug this as I frankly don't know anything about symbol mangling on 32-bit Windows. The diagnosis seems plausible however, and this resolved the build failure.
Edit:
The specific error above was resolved by #245
This now fixes
from https://github.com/rust-secure-code/cargo-auditable/actions/runs/22680924943/job/65750878044