test #[naked] with #[link_section = "..."] on windows#154598
Open
folkertdev wants to merge 1 commit intorust-lang:mainfrom
Open
test #[naked] with #[link_section = "..."] on windows#154598folkertdev wants to merge 1 commit intorust-lang:mainfrom
#[naked] with #[link_section = "..."] on windows#154598folkertdev wants to merge 1 commit intorust-lang:mainfrom
Conversation
folkertdev
commented
Mar 30, 2026
Comment on lines
-270
to
+284
| let section = link_section.unwrap_or_else(|| format!(".text.{asm_name}")); | ||
| writeln!(begin, ".pushsection {},\"xr\"", section).unwrap(); | ||
| writeln!(begin, ".balign {align_bytes}").unwrap(); | ||
| write_linkage(&mut begin).unwrap(); | ||
| writeln!(begin, ".def {asm_name}").unwrap(); | ||
| writeln!(begin, ".scl 2").unwrap(); | ||
| writeln!(begin, ".type 32").unwrap(); | ||
| writeln!(begin, ".endef").unwrap(); | ||
|
|
||
| let section = link_section.unwrap_or_else(|| format!(".text.{asm_name}")); | ||
| writeln!(begin, ".pushsection {},\"xr\"", section).unwrap(); | ||
| write_linkage(&mut begin).unwrap(); | ||
| writeln!(begin, ".balign {align_bytes}").unwrap(); |
Contributor
Author
There was a problem hiding this comment.
This just got moved up so that .def comes before the .pushsection.
Comment on lines
-281
to
-282
| writeln!(end, ".Lfunc_end_{asm_name}:").unwrap(); | ||
| writeln!(end, ".popsection").unwrap(); |
Contributor
Author
There was a problem hiding this comment.
LLVM does not emit these, so then we should not need to either
Comment on lines
+144
to
+151
| // Pick a default alignment when the alignment is not explicitly specified. | ||
| let align_bytes = match attrs.alignment { | ||
| Some(align) => align.bytes(), | ||
| None => match asm_binary_format { | ||
| BinaryFormat::Coff => 16, | ||
| _ => 4, | ||
| }, | ||
| }; |
Contributor
Author
There was a problem hiding this comment.
I don't think this really matters but we may as well match LLVM
Contributor
Author
|
@bors try jobs=x86_64-mingw-1 |
This comment has been minimized.
This comment has been minimized.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 30, 2026
test `#[naked]` with `#[link_section = "..."]` on windows try-job: x86_64-mingw-1
This comment has been minimized.
This comment has been minimized.
f445a7c to
b1287a8
Compare
Contributor
|
💔 Test for e60d030 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
b1287a8 to
984fb02
Compare
Contributor
Author
|
@bors try jobs=x86_64-mingw-1 |
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 30, 2026
test `#[naked]` with `#[link_section = "..."]` on windows try-job: x86_64-mingw-1
Contributor
|
⌛ Trying commit 984fb02 with merge d4f9c71… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/23765423894 |
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.
As a part of #147811 I ran into that we actually don't match (current) LLVM output.
r? @mati865