Skip to content

Add a default implementation for CodegenBackend::link #132820

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Nov 9, 2024

As a side effect this should add raw-dylib support to cg_gcc as the default ArchiveBuilderBuilder that is used implements create_dll_import_lib. I haven't tested if the raw-dylib support actually works however.

As a side effect this should add raw-dylib support to cg_gcc as the
default ArchiveBuilderBuilder that is used implements
create_dll_import_lib. I haven't tested if the raw-dylib support
actually works however.
@rustbot
Copy link
Collaborator

rustbot commented Nov 9, 2024

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
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
Copy link
Collaborator

rustbot commented Nov 9, 2024

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@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 Nov 9, 2024
After link_binary the temporary files referenced by CodegenResults are
deleted, so calling link_binary again with the same CodegenResults
should not be allowed.
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the default_backend_link_impl branch from 97f5f0f to 996e728 Compare November 10, 2024 09:59
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the default_backend_link_impl branch from 996e728 to e8b1029 Compare November 10, 2024 10:38
@antoyo
Copy link
Contributor

antoyo commented Nov 10, 2024

Does this still allow overwriting the linking step in the different codegens?

I sometimes stumble upon cases where I need to adjust the linking for rustc_codegen_gcc.

@bjorn3
Copy link
Member Author

bjorn3 commented Nov 10, 2024

Yes, this only adds a default impl. The LLVM backend still overrides the link method as it uses a different archive writer that supports reading symbols for LLVM bitcode.

@jieyouxu
Copy link
Member

r? jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned BoxyUwU Nov 11, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks. This adds a default impl that can be overridden, so this LGTM.

@jieyouxu
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 11, 2024

📌 Commit e8b1029 has been approved by jieyouxu

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 Nov 11, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 11, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#120077 (Add Set entry API )
 - rust-lang#132144 (Arbitrary self types v2: (unused) Receiver trait)
 - rust-lang#132297 (Document some `check_expr` methods, and other misc `hir_typeck` tweaks)
 - rust-lang#132820 (Add a default implementation for CodegenBackend::link)
 - rust-lang#132881 (triagebot: Autolabel rustdoc book)
 - rust-lang#132912 (Simplify some places that deal with generic parameter defaults)
 - rust-lang#132916 (Unvacation fmease)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 12, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#120077 (Add Set entry API )
 - rust-lang#132144 (Arbitrary self types v2: (unused) Receiver trait)
 - rust-lang#132297 (Document some `check_expr` methods, and other misc `hir_typeck` tweaks)
 - rust-lang#132820 (Add a default implementation for CodegenBackend::link)
 - rust-lang#132881 (triagebot: Autolabel rustdoc book)
 - rust-lang#132912 (Simplify some places that deal with generic parameter defaults)
 - rust-lang#132916 (Unvacation fmease)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 35225d6 into rust-lang:master Nov 12, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 12, 2024
Rollup merge of rust-lang#132820 - bjorn3:default_backend_link_impl, r=jieyouxu

Add a default implementation for CodegenBackend::link

As a side effect this should add raw-dylib support to cg_gcc as the default ArchiveBuilderBuilder that is used implements create_dll_import_lib. I haven't tested if the raw-dylib support actually works however.
@bjorn3 bjorn3 deleted the default_backend_link_impl branch November 12, 2024 19:51
# for free to join this conversation on GitHub. Already have an account? # 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.

7 participants