Skip to content

Conversation

@saethlin
Copy link
Member

No description provided.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 20, 2025
@saethlin saethlin force-pushed the dont-prefer-c-builtins branch from 7bfc464 to 368b2ef Compare December 20, 2025 02:23
@saethlin saethlin changed the title Prefer any other crate over c-builtins when selecting an upstream monomorphization Don't export upstream monomorphizations from compiler-builtins Dec 20, 2025
@saethlin
Copy link
Member Author

r? bjorn3

@saethlin saethlin marked this pull request as ready for review December 20, 2025 03:28
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 20, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2025

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
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

@saethlin
Copy link
Member Author

🤨

r? bjorn3

@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2025

Requested reviewer is already assigned to this pull request.

Please choose another assignee.

@durin42
Copy link
Contributor

durin42 commented Dec 20, 2025

Patched it in and built a toolchain so I could test it on my Mac, and as far as I can tell this does fix the problem. Thanks for a quick fix!

// https://github.com/rust-lang/rust/issues/150173
if tcx.is_compiler_builtins(cnum) {
continue;
}
Copy link
Member

Choose a reason for hiding this comment

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

Alternatively could we avoid returning anything from exported_generic_symbols when building compiler-builtins? All symbols in compiler-builtins have hidden visibility and as such we don't tell the linker to export them either.

Also does this PR mean the special case at

// compiler_builtins cannot use upstream monomorphizations.
if tcx.is_compiler_builtins(LOCAL_CRATE) {
return None;
}
can be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Alternatively could we avoid returning anything from exported_generic_symbols when building compiler-builtins?

This occurred to me as well as I was falling asleep. I'll try it out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also does this PR mean the special case at

I don't think that special case can be removed, because that is supposed to block compiler-builtins from calling into a monomorphization exported by core.

@saethlin saethlin force-pushed the dont-prefer-c-builtins branch from 368b2ef to 44a9d84 Compare December 20, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants