Skip to content

Commit

Permalink
Rollup merge of #114069 - cuviper:profiler-path, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GuillaumeGomez committed Aug 13, 2023
2 parents be41121 + 6098b34 commit b93842a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions profiler_builtins/build.rs
Expand Up @@ -6,6 +6,12 @@ use std::env;
use std::path::Path;

fn main() {
println!("cargo:rerun-if-env-changed=LLVM_PROFILER_RT_LIB");
if let Ok(rt) = env::var("LLVM_PROFILER_RT_LIB") {
println!("cargo:rustc-link-lib=static:+verbatim={rt}");
return;
}

let target = env::var("TARGET").expect("TARGET was not set");
let cfg = &mut cc::Build::new();

Expand Down

0 comments on commit b93842a

Please sign in to comment.