Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 28, 2020

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Sep 8, 2020

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
Collaborator

r? @nikomatsakis

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 8, 2020
@bjorn3 bjorn3 force-pushed the driver_selected_codegen branch from fbd8ca8 to be040dc Compare September 8, 2020 14:30
@bors

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the driver_selected_codegen branch from be040dc to 1745328 Compare September 21, 2020 13:48
@bjorn3
Copy link
Member Author

bjorn3 commented Sep 21, 2020

Rebased

@bjorn3 bjorn3 force-pushed the driver_selected_codegen branch from 1745328 to 79a086e Compare September 27, 2020 12:13
@bjorn3 bjorn3 force-pushed the driver_selected_codegen branch from 79a086e to 71bc62b Compare September 27, 2020 12:16
@bjorn3

This comment has been minimized.

@jyn514 jyn514 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
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.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 28, 2020

r? @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Sep 28, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Sep 28, 2020

📌 Commit 71bc62b has been approved by oli-obk

@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 Sep 28, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Sep 28, 2020

@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)
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)
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:master Sep 28, 2020
@rustbot rustbot 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 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.

8 participants