Skip to content

Conversation

osamakader
Copy link
Contributor

@osamakader osamakader commented Oct 16, 2025

Fixes #147487

@rustbot
Copy link
Collaborator

rustbot commented Oct 16, 2025

r? @petrochenkov

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

@rustbot rustbot added 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 Oct 16, 2025
@rustbot

This comment has been minimized.

@petrochenkov
Copy link
Contributor

r=me after fixing up the commit message #147792 (comment).
@bors rollup
@rustbot author

@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 17, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 17, 2025

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

When -Z autodiff=Enable is used, the compiler automatically enables
fat-lto for all crates. However, proc-macro crates cannot use fat-lto
without the -Zdylib-lto flag, causing compilation errors.

This commit modifies the lto() method in Session to exclude proc-macro
crates from fat-lto when autodiff is enabled, while preserving the
existing behavior for all other crate types.

The fix ensures that:
- Non-proc-macro crates still get fat-lto when autodiff is enabled
- Proc-macro crates are excluded from fat-lto when autodiff is enabled
- Existing autodiff functionality remains unchanged for regular crates

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
@osamakader osamakader force-pushed the fix-autodiff-proc-macro-lto branch from e75f796 to e67d502 Compare October 17, 2025 13:53
@osamakader
Copy link
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 17, 2025
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 17, 2025

📌 Commit e67d502 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors 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 17, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 17, 2025
…-lto, r=petrochenkov

Fix autodiff incorrectly applying fat-lto to proc-macro crates

Fixes rust-lang#147487
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 17, 2025
…-lto, r=petrochenkov

Fix autodiff incorrectly applying fat-lto to proc-macro crates

Fixes rust-lang#147487
bors added a commit that referenced this pull request Oct 17, 2025
Rollup of 7 pull requests

Successful merges:

 - #140153 (Implement `Debug` for `EncodeWide`)
 - #147454 (Fix backtraces with `-C panic=abort` on qnx; emit unwind tables by default)
 - #147468 (Implement fs api set_times and set_times_nofollow)
 - #147494 (std::thread spawn: Docs: Link to Builder::spawn; Make same.)
 - #147783 (bootstrap: migrate to object 0.37)
 - #147792 (Fix autodiff incorrectly applying fat-lto to proc-macro crates )
 - #147809 (rustdoc: Fix passes order so intra-doc links are collected after stripping passes)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Oct 18, 2025
Rollup of 6 pull requests

Successful merges:

 - #146509 (Result/Option layout guarantee clarifications)
 - #147494 (std::thread spawn: Docs: Link to Builder::spawn; Make same.)
 - #147532 ( Port `#[cfg_attr]` to the new attribute parsing infrastructure)
 - #147783 (bootstrap: migrate to object 0.37)
 - #147792 (Fix autodiff incorrectly applying fat-lto to proc-macro crates )
 - #147809 (rustdoc: Fix passes order so intra-doc links are collected after stripping passes)

Failed merges:

 - #147813 (Warn on unused_attributes in uitests )

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7fa2030 into rust-lang:master Oct 18, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 18, 2025
rust-timer added a commit that referenced this pull request Oct 18, 2025
Rollup merge of #147792 - osamakader:fix-autodiff-proc-macro-lto, r=petrochenkov

Fix autodiff incorrectly applying fat-lto to proc-macro crates

Fixes #147487
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

autodiff incorrectly applies fat-lto to proc-macro crate.

4 participants