Skip to content

Commit e29a8ed

Browse files
Make run-make work with other codegen backend than LLVM
1 parent 46a266b commit e29a8ed

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/tools/compiletest/src/runtest/run_make.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ impl TestCx<'_> {
201201
.env("RUSTC", &self.config.rustc_path)
202202
// Provide which LLVM components are available (e.g. which LLVM components are provided
203203
// through a specific CI runner).
204-
.env("LLVM_COMPONENTS", &self.config.llvm_components);
204+
.env("LLVM_COMPONENTS", &self.config.llvm_components)
205+
// In case it's a different codegen backend than LLVM.
206+
.env("RUSTC_CODEGEN_BACKEND", self.config.default_codegen_backend.as_str());
205207

206208
// The `run-make-cargo` and `build-std` suites need an in-tree `cargo`, `run-make` does not.
207209
if matches!(self.config.suite, TestSuite::RunMakeCargo | TestSuite::BuildStd) {

src/tools/run-make-support/src/external_deps/rustc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ pub fn rustc_path() -> String {
7676
fn setup_common() -> Command {
7777
let mut cmd = Command::new(rustc_path());
7878
set_host_compiler_dylib_path(&mut cmd);
79+
eprintln!("-----> {:?}", std::env::var("RUSTC_CODEGEN_BACKEND"));
80+
if let Ok(codegen_backend) = std::env::var("RUSTC_CODEGEN_BACKEND") {
81+
cmd.arg(format!("-Zcodegen-backend={codegen_backend}"));
82+
}
7983
cmd
8084
}
8185

0 commit comments

Comments
 (0)