Skip to content

Commit

Permalink
Handle changed InstrProfilingRuntime path
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jan 3, 2020
1 parent b2da2a1 commit 26bf168
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/libprofiler_builtins/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ fn main() {
"InstrProfilingPlatformLinux.c",
"InstrProfilingPlatformOther.c",
"InstrProfilingPlatformWindows.c",
"InstrProfilingRuntime.cc",
"InstrProfilingUtil.c",
"InstrProfilingValue.c",
"InstrProfilingWriter.c",
Expand Down Expand Up @@ -68,10 +67,16 @@ fn main() {
let root = env::var_os("RUST_COMPILER_RT_ROOT").unwrap();
let root = Path::new(&root);

let src_root = root.join("lib").join("profile");
for src in profile_sources {
cfg.file(root.join("lib").join("profile").join(src));
cfg.file(src_root.join(src));
}

// The file was renamed in LLVM 10.
let old_runtime_path = src_root.join("InstrProfilingRuntime.cc");
let new_runtime_path = src_root.join("InstrProfilingRuntime.cpp");
cfg.file(if old_runtime_path.exists() { old_runtime_path } else { new_runtime_path });

cfg.include(root.join("include"));
cfg.warnings(false);
cfg.compile("profiler-rt");
Expand Down

0 comments on commit 26bf168

Please sign in to comment.