Skip to content

Commit b93842a

Browse files
Rollup merge of rust-lang#114069 - cuviper:profiler-path, r=Mark-Simulacrum
Allow using external builds of the compiler-rt profile lib This changes the bootstrap config `target.*.profiler` from a plain bool to also allow a string, which will be used as a path to the pre-built profiling runtime for that target. Then `profiler_builtins/build.rs` reads that in a `LLVM_PROFILER_RT_LIB` environment variable.
2 parents be41121 + 6098b34 commit b93842a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

profiler_builtins/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ use std::env;
66
use std::path::Path;
77

88
fn main() {
9+
println!("cargo:rerun-if-env-changed=LLVM_PROFILER_RT_LIB");
10+
if let Ok(rt) = env::var("LLVM_PROFILER_RT_LIB") {
11+
println!("cargo:rustc-link-lib=static:+verbatim={rt}");
12+
return;
13+
}
14+
915
let target = env::var("TARGET").expect("TARGET was not set");
1016
let cfg = &mut cc::Build::new();
1117

0 commit comments

Comments
 (0)