Skip to content

Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports - #163462

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cezarbbb:symbol-edit-undecorate-coff
Oct 8, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cezarbbb:symbol-edit-undecorate-coff

Conversation

@cezarbbb

@cezarbbb cezarbbb commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

#163188 handled Arm64EC's # mangling in symbol_edit, but COFF decoration support there
was still incomplete: matching against exported symbols only stripped the i686 _ prefix,
so stdcall/fastcall/vectorcall exports were wrongly treated as internal and renamed.
link.rs already had the full undecoration, so this shares it as
symbol_export::undecorate_coff_symbol, uses it from both places, and covers the
decorated calling conventions in the run-make test.

LLM disclosure: Initially, I mistakenly over-scoped the extraction of the shared undecorate logic; the LLM helped me narrow the scope and ultimately pinpoint a single function, and I am currently using the streamlined version it suggested. Additionally, the LLM assisted me in designing the specific test functions within decorated_lib.rs.

r? @bjorn3

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 29, 2026
Comment thread compiler/rustc_codegen_ssa/src/back/symbol_export.rs Outdated
Comment thread compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Comment thread compiler/rustc_codegen_ssa/src/back/symbol_export.rs Outdated
Comment thread compiler/rustc_codegen_ssa/src/back/symbol_export.rs Outdated
Comment thread tests/run-make/staticlib-rename-internal-symbols-coff/decorated_lib.rs Outdated
Comment thread tests/run-make/staticlib-rename-internal-symbols-coff/rmake.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 2, 2026
@rustbot

rustbot commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@cezarbbb
cezarbbb force-pushed the symbol-edit-undecorate-coff branch from 33a8e64 to 3e2bec1 Compare October 8, 2026 01:42
@cezarbbb

cezarbbb commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 8, 2026
@bjorn3

bjorn3 commented Oct 8, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3e2bec1 has been approved by bjorn3

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Oct 8, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…ff, r=bjorn3

Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports

rust-lang#163188 handled Arm64EC's `#` mangling in `symbol_edit`, but COFF decoration support there
was still incomplete: matching against exported symbols only stripped the i686 `_` prefix,
so `stdcall`/`fastcall`/`vectorcall` exports were wrongly treated as internal and renamed.
`link.rs` already had the full undecoration, so this shares it as
`symbol_export::undecorate_coff_symbol`, uses it from both places, and covers the
decorated calling conventions in the run-make test.

LLM disclosure: Initially, I mistakenly over-scoped the extraction of the shared undecorate logic; the LLM helped me narrow the scope and ultimately pinpoint a single function, and I am currently using the streamlined version it suggested. Additionally, the LLM assisted me in designing the specific test functions within `decorated_lib.rs`.

r? @bjorn3
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…ff, r=bjorn3

Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports

rust-lang#163188 handled Arm64EC's `#` mangling in `symbol_edit`, but COFF decoration support there
was still incomplete: matching against exported symbols only stripped the i686 `_` prefix,
so `stdcall`/`fastcall`/`vectorcall` exports were wrongly treated as internal and renamed.
`link.rs` already had the full undecoration, so this shares it as
`symbol_export::undecorate_coff_symbol`, uses it from both places, and covers the
decorated calling conventions in the run-make test.

LLM disclosure: Initially, I mistakenly over-scoped the extraction of the shared undecorate logic; the LLM helped me narrow the scope and ultimately pinpoint a single function, and I am currently using the streamlined version it suggested. Additionally, the LLM assisted me in designing the specific test functions within `decorated_lib.rs`.

r? @bjorn3
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #163462 (Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports)
 - #163855 (Include enclosing item's context on const errors)
 - #163861 (Run LLDB debuginfo tests on `x86_64-mingw`)
 - #163538 (Add `rustc::missing_generic_type_visitable` lint)
 - #163617 (mips: make `Complex<T>` ABI match GCC)
 - #163832 (reject non-async coroutine closures as async callables)
 - #163958 (only make `RustaceansAreAwesome` satisfy trait clauses)
 - #163974 (Condense AdtDef lang item checks into one match)
 - #163979 (Add `bf16` to arm features)

Failed merges:

 - #163972 (const-eval: ICE when we hit a non-const fn)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…ff, r=bjorn3

Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports

rust-lang#163188 handled Arm64EC's `#` mangling in `symbol_edit`, but COFF decoration support there
was still incomplete: matching against exported symbols only stripped the i686 `_` prefix,
so `stdcall`/`fastcall`/`vectorcall` exports were wrongly treated as internal and renamed.
`link.rs` already had the full undecoration, so this shares it as
`symbol_export::undecorate_coff_symbol`, uses it from both places, and covers the
decorated calling conventions in the run-make test.

LLM disclosure: Initially, I mistakenly over-scoped the extraction of the shared undecorate logic; the LLM helped me narrow the scope and ultimately pinpoint a single function, and I am currently using the streamlined version it suggested. Additionally, the LLM assisted me in designing the specific test functions within `decorated_lib.rs`.

r? @bjorn3
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #163462 (Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports)
 - #163855 (Include enclosing item's context on const errors)
 - #163861 (Run LLDB debuginfo tests on `x86_64-mingw`)
 - #161201 (Speed up tidy again)
 - #163538 (Add `rustc::missing_generic_type_visitable` lint)
 - #163617 (mips: make `Complex<T>` ABI match GCC)
 - #163772 (comptime fn error: suggest wrapping in const block)
 - #163832 (reject non-async coroutine closures as async callables)
 - #163958 (only make `RustaceansAreAwesome` satisfy trait clauses)
 - #163974 (Condense AdtDef lang item checks into one match)
 - #163979 (Add `bf16` to arm features)
 - #163989 (Revert "compiletest: stream output of executor process when --no-capture is set")

Failed merges:

 - #163972 (const-eval: ICE when we hit a non-const fn)
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #156112 (Distinguish `repr(C)` ZSTs from others in ABI computation)
 - #157941 (Deny partial `-Z stack-protector` by default in all editions)
 - #163462 (Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports)
 - #163855 (Include enclosing item's context on const errors)
 - #163861 (Run LLDB debuginfo tests on `x86_64-mingw`)
 - #163913 ( Silence redundant failed obligations on the same statement)
 - #161201 (Speed up tidy again)
 - #163380 (Tweak "name not found" resolution error when it happens from within a derive expansion)
 - #163538 (Add `rustc::missing_generic_type_visitable` lint)
 - #163617 (mips: make `Complex<T>` ABI match GCC)
 - #163772 (comptime fn error: suggest wrapping in const block)
 - #163813 (use pre-borrowck typing env for early MIR validation)
 - #163924 (replace instances of NonNull::new(&mut x).expect("...") with NonNull::from_mut)
 - #163958 (only make `RustaceansAreAwesome` satisfy trait clauses)
 - #163960 (vexos: clear .bss from assembly)
 - #163974 (Condense AdtDef lang item checks into one match)
 - #163979 (Add `bf16` to arm features)
 - #163989 (Revert "compiletest: stream output of executor process when --no-capture is set")
 - #163995 (m68k-unknown-none-elf: Remove code model)

Failed merges:

 - #163832 (reject non-async coroutine closures as async callables)
 - #163972 (const-eval: ICE when we hit a non-const fn)
@rust-bors
rust-bors Bot merged commit 364c485 into rust-lang:main Oct 8, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
Rollup merge of #163462 - cezarbbb:symbol-edit-undecorate-coff, r=bjorn3

Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports

#163188 handled Arm64EC's `#` mangling in `symbol_edit`, but COFF decoration support there
was still incomplete: matching against exported symbols only stripped the i686 `_` prefix,
so `stdcall`/`fastcall`/`vectorcall` exports were wrongly treated as internal and renamed.
`link.rs` already had the full undecoration, so this shares it as
`symbol_export::undecorate_coff_symbol`, uses it from both places, and covers the
decorated calling conventions in the run-make test.

LLM disclosure: Initially, I mistakenly over-scoped the extraction of the shared undecorate logic; the LLM helped me narrow the scope and ultimately pinpoint a single function, and I am currently using the streamlined version it suggested. Additionally, the LLM assisted me in designing the specific test functions within `decorated_lib.rs`.

r? @bjorn3
programskillforverification pushed a commit to programskillforverification/miri that referenced this pull request Oct 9, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#156112 (Distinguish `repr(C)` ZSTs from others in ABI computation)
 - rust-lang/rust#157941 (Deny partial `-Z stack-protector` by default in all editions)
 - rust-lang/rust#163462 (Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports)
 - rust-lang/rust#163855 (Include enclosing item's context on const errors)
 - rust-lang/rust#163861 (Run LLDB debuginfo tests on `x86_64-mingw`)
 - rust-lang/rust#163913 ( Silence redundant failed obligations on the same statement)
 - rust-lang/rust#161201 (Speed up tidy again)
 - rust-lang/rust#163380 (Tweak "name not found" resolution error when it happens from within a derive expansion)
 - rust-lang/rust#163538 (Add `rustc::missing_generic_type_visitable` lint)
 - rust-lang/rust#163617 (mips: make `Complex<T>` ABI match GCC)
 - rust-lang/rust#163772 (comptime fn error: suggest wrapping in const block)
 - rust-lang/rust#163813 (use pre-borrowck typing env for early MIR validation)
 - rust-lang/rust#163924 (replace instances of NonNull::new(&mut x).expect("...") with NonNull::from_mut)
 - rust-lang/rust#163958 (only make `RustaceansAreAwesome` satisfy trait clauses)
 - rust-lang/rust#163960 (vexos: clear .bss from assembly)
 - rust-lang/rust#163974 (Condense AdtDef lang item checks into one match)
 - rust-lang/rust#163979 (Add `bf16` to arm features)
 - rust-lang/rust#163989 (Revert "compiletest: stream output of executor process when --no-capture is set")
 - rust-lang/rust#163995 (m68k-unknown-none-elf: Remove code model)

Failed merges:

 - rust-lang/rust#163832 (reject non-async coroutine closures as async callables)
 - rust-lang/rust#163972 (const-eval: ICE when we hit a non-const fn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants