Skip to content

Allow two object files for a single CGU in CompiledModule#157051

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
bjorn3:lto_refactors20
May 30, 2026
Merged

Allow two object files for a single CGU in CompiledModule#157051
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
bjorn3:lto_refactors20

Conversation

@bjorn3
Copy link
Copy Markdown
Member

@bjorn3 bjorn3 commented May 28, 2026

cg_clif needs this as it passes inline assembly to an external assembler, producing a separate object file. Currently it emits multiple CompiledModules, but this is not compatible with using the codegen coordinator of cg_ssa.

cg_clif needs this as it passes inline assembly to an external assembler,
producing a separate object file. Currently it emits multiple
CompiledModules, but this is not compatible with using the codegen
coordinator of cg_ssa.
@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 May 28, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 28, 2026

r? @folkertdev

rustbot has assigned @folkertdev.
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: compiler
  • compiler expanded to 73 candidates
  • Random selection from 18 candidates

}
if let Some(obj) = &m.global_asm_object {
check_file_is_writeable(obj, sess);
}
Copy link
Copy Markdown
Member Author

@bjorn3 bjorn3 May 28, 2026

Choose a reason for hiding this comment

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

Maybe a .objects() helper that returns impl Iterator<Item = &Path> would be useful?

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤷 the code is only in here two times which is an acceptable level of copy-paste for me.

@folkertdev
Copy link
Copy Markdown
Contributor

Not really my area of expertise, maybe

r? saethlin

@rustbot rustbot assigned saethlin and unassigned folkertdev May 28, 2026
@saethlin
Copy link
Copy Markdown
Member

Boilerplatey, but a reasonable extension to the existing logic.

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 29, 2026

📌 Commit e731b4e has been approved by saethlin

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened.

@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 May 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 30, 2026
Allow two object files for a single CGU in CompiledModule

cg_clif needs this as it passes inline assembly to an external assembler, producing a separate object file. Currently it emits multiple CompiledModules, but this is not compatible with using the codegen coordinator of cg_ssa.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 30, 2026
Allow two object files for a single CGU in CompiledModule

cg_clif needs this as it passes inline assembly to an external assembler, producing a separate object file. Currently it emits multiple CompiledModules, but this is not compatible with using the codegen coordinator of cg_ssa.
rust-bors Bot pushed a commit that referenced this pull request May 30, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #154591 (Remove `will_cache_on_disk_for_key_fn`)
 - #156672 (Misc improvements to coroutine transform code)
 - #157027 (HIR ty lowering: Move some things into submodules)
 - #157051 (Allow two object files for a single CGU in CompiledModule)
 - #157100 (Some more per owner things)
 - #153497 (Use `trait_object_dummy_self` more & heavily fix+update related docs)
 - #155638 (Fix tupled closure signature in `AsyncFn` arg mismatch diagnostic)
 - #156826 (style: Clarify nullary call and `()` no-break rule applies past max width)
 - #157004 (Remove unused functions in `value_analysis.rs`)
 - #157032 (Fixed more &x ->&mut x suggestions)
 - #157033 (Note irrefutable while let in loop type errors)
 - #157139 (compiler: `ops::RangeInclusive` → `range::RangeInclusive`)

Failed merges:

 - #156875 (Correct and document semantics of `yield` terminator)
@rust-bors rust-bors Bot merged commit b8c03ee into rust-lang:main May 30, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone May 30, 2026
rust-timer added a commit that referenced this pull request May 30, 2026
Rollup merge of #157051 - bjorn3:lto_refactors20, r=saethlin

Allow two object files for a single CGU in CompiledModule

cg_clif needs this as it passes inline assembly to an external assembler, producing a separate object file. Currently it emits multiple CompiledModules, but this is not compatible with using the codegen coordinator of cg_ssa.
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.

4 participants