Skip to content

Add option to pass a custom codegen backend from a driver - #76474

Merged
bors merged 1 commit into
rust-lang:masterfrom
bjorn3:driver_selected_codegen
Sep 28, 2020
Merged

Add option to pass a custom codegen backend from a driver#76474
bors merged 1 commit into
rust-lang:masterfrom
bjorn3:driver_selected_codegen

Conversation

@bjorn3

Copy link
Copy Markdown
Member

This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process.

This PR may also help with rust-lang/miri#1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen.

cc @nbaksalyar (headcrab)
cc @RalfJung (miri)

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 8, 2020
Comment threadcompiler/rustc_driver/src/lib.rs Outdated
@bjorn3
bjorn3force-pushed the driver_selected_codegen branch from fbd8ca8 to be040dcCompareSeptember 8, 2020 14:30
@bors

This comment has been minimized.

@bjorn3
bjorn3force-pushed the driver_selected_codegen branch from be040dc to 1745328CompareSeptember 21, 2020 13:48
@bjorn3

Copy link
Copy Markdown
MemberAuthor

Rebased

@bjorn3
bjorn3force-pushed the driver_selected_codegen branch from 1745328 to 79a086eCompareSeptember 27, 2020 12:13
@bjorn3
bjorn3force-pushed the driver_selected_codegen branch from 79a086e to 71bc62bCompareSeptember 27, 2020 12:16
@bjorn3

This comment has been minimized.

@jyn514jyn514 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 27, 2020
@RalfJung

Copy link
Copy Markdown
Member

FWIW, I had not realized how hard it is to write a stub codegen backend that does nothing, so using this in Miri will be tricky -- this is just the first step. But it seems like a reasonable first step to me anyway.

Not sure who would be a good reviewer though... I'll bring this up on Zulip.

Comment threadcompiler/rustc_driver/src/lib.rs
@oli-obk

Copy link
Copy Markdown
Contributor

r? @oli-obk

@oli-obk

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Sep 28, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 71bc62b has been approved by oli-obk

@borsbors 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 Sep 28, 2020
@oli-obk

Copy link
Copy Markdown
Contributor

@bors rollup

RalfJung added a commit to RalfJung/rust that referenced this pull request Sep 28, 2020
…li-obk
Add option to pass a custom codegen backend from a driver
This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process.
This PR may also help with rust-lang/miri#1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen.
cc @nbaksalyar (headcrab)
cc @RalfJung (miri)
@RalfJungRalfJung mentioned this pull request Sep 28, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 28, 2020
…li-obk
Add option to pass a custom codegen backend from a driver
This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process.
This PR may also help with rust-lang/miri#1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen.
cc @nbaksalyar (headcrab)
cc @RalfJung (miri)
@RalfJungRalfJung mentioned this pull request Sep 28, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2020
Rollup of 7 pull requests
Successful merges:
- rust-lang#76454 (UI to unit test for those using Cell/RefCell/UnsafeCell)
- rust-lang#76474 (Add option to pass a custom codegen backend from a driver)
- rust-lang#76711 (diag: improve closure/generic parameter mismatch)
- rust-lang#77170 (Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]`)
- rust-lang#77194 (Add doc alias for iterator fold)
- rust-lang#77288 (fix building libstd for Miri on macOS)
- rust-lang#77295 (Update unstable-book: Fix ABNF in inline assembly docs)
Failed merges:
r? `@ghost`
@bors
bors merged commit 6a8cdbd into rust-lang:masterSep 28, 2020
@rustbotrustbot added this to the 1.48.0 milestone Sep 28, 2020
@bjorn3
bjorn3 deleted the driver_selected_codegen branch September 28, 2020 21:03
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 9, 2020
…li-obk
Add option to pass a custom codegen backend from a driver
This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process.
This PR may also help with rust-lang/miri#1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen.
cc @nbaksalyar (headcrab)
cc @RalfJung (miri)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@bjorn3@rust-highfive@bors@RalfJung@oli-obk@nikomatsakis@jyn514@rustbot