Skip to content

export symbols: support macos/windows(32/64)#155535

Open
cezarbbb wants to merge 1 commit intorust-lang:mainfrom
cezarbbb:cstyle-export-symbols
Open

export symbols: support macos/windows(32/64)#155535
cezarbbb wants to merge 1 commit intorust-lang:mainfrom
cezarbbb:cstyle-export-symbols

Conversation

@cezarbbb
Copy link
Copy Markdown
Contributor

@cezarbbb cezarbbb commented Apr 20, 2026

View all comments

Previously, in the pr #150992 , export symbols only supported Linux. The special prefix and suffix rules for some symbols in macOS and Windows were not fully supported. This pull request attempts to clarify these rules and add corresponding support.

Currently, the undecorate_c_symbol() function has been added to handle macOS _ prefixes, Windows x86 calling convention modifiers (cdecl/stdcall/fastcall/vectorcall), and Arm64EC # prefixes.

r? @bjorn3 @petrochenkov

@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 Apr 20, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: codegen, compiler
  • codegen, compiler expanded to 72 candidates
  • Random selection from 16 candidates

@rustbot rustbot assigned bjorn3 and unassigned wesleywiser Apr 20, 2026
@cezarbbb
Copy link
Copy Markdown
Contributor Author

Could someone pls give me permission to test whether the current modifications will work correctly on Windows and macOS?
Cause I don't have the corresponding devices.

@adwinwhite
Copy link
Copy Markdown
Contributor

@bors delegate=try

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 20, 2026

✌️ @cezarbbb, you can now perform try builds on this pull request!

You can now post @bors try to start a try build.

@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors delegate=try

Thanks!!! It helps me a lot:>

@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors try jobs=x86_64-msvc-*

rust-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
export symbols: support macos/windows(32/64)


try-job: x86_64-msvc-*
@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot 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 Apr 20, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 20, 2026

💔 Test for 22e628f failed: CI. Failed job:

@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors try jobs=x86_64-msvc-*

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
export symbols: support macos/windows(32/64)


try-job: x86_64-msvc-*
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 20, 2026

💔 Test for 71d836c failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors try jobs=x86_64-msvc-*

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
export symbols: support macos/windows(32/64)


try-job: x86_64-msvc-*
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 20, 2026

☀️ Try build successful (CI)
Build commit: 6d8d88e (6d8d88e3ab7025c82dc5ed03d96874614fdf1189, parent: e22c616e4e87914135c1db261a03e0437255335e)

@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors try jobs=aarch64-*

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
export symbols: support macos/windows(32/64)


try-job: aarch64-*
@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors try jobs=aarch64-*

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
export symbols: support macos/windows(32/64)


try-job: aarch64-*
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 20, 2026

💔 Test for b1da8fd failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors try jobs=aarch64-*

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 21, 2026
export symbols: support macos/windows(32/64)


try-job: aarch64-*
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@madsmtm madsmtm added O-windows Operating system: Windows O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) labels Apr 21, 2026
@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors try jobs=aarch64-*

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 21, 2026
export symbols: support macos/windows(32/64)


try-job: aarch64-*
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

☀️ Try build successful (CI)
Build commit: a028460 (a02846004e7d4d0b4627bf3408dfb9f6f765a961, parent: 4fbae3e30923ca23262b696d54ddbd176c2c38b4)

@cezarbbb cezarbbb force-pushed the cstyle-export-symbols branch from 00a6cab to 5a2b2d2 Compare April 21, 2026 06:17
@cezarbbb
Copy link
Copy Markdown
Contributor Author

Tests passed. Let me squash these commits to one commit.

@cezarbbb
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 Apr 21, 2026
Copy link
Copy Markdown
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some questions that might require further explanation (comments, tests, or code tweaks).

View changes since this review

Comment thread compiler/rustc_codegen_ssa/src/back/link.rs
Comment thread compiler/rustc_codegen_ssa/src/back/link.rs
@cezarbbb cezarbbb force-pushed the cstyle-export-symbols branch from 5a2b2d2 to c5002ba Compare April 21, 2026 11:02
@cezarbbb
Copy link
Copy Markdown
Contributor Author

@bors try jobs=x86_64-msvc-*

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 21, 2026
export symbols: support macos/windows(32/64)


try-job: x86_64-msvc-*
@bjorn3
Copy link
Copy Markdown
Member

bjorn3 commented Apr 21, 2026

Do I understand it correctly that this doesn't handle C++ symbol name undecorating on Windows?

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

☀️ Try build successful (CI)
Build commit: 7977a6e (7977a6ed133f7501da23e1bc1d4889d664f3495d, parent: 9ab01ae53c416f89fe256b79588a76dcbcdc9290)

@cezarbbb
Copy link
Copy Markdown
Contributor Author

Do I understand it correctly that this doesn't handle C++ symbol name undecorating on Windows?

Yes, this only handles C symbol name decoration.

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 O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) O-windows Operating system: Windows 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants