diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-04 00:19:37 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-07 21:28:22 +0100 |
| commit | c6a7751fa7ad31702e389128c4d970324d0aa2cd (patch) | |
| tree | e0661ea2a4ddccea9ab546ed5239d0b239125408 /src/libprofiler_builtins | |
| parent | 3db0015499d002f6e1dff1b615877e9131cfeb25 (diff) | |
| download | rust-c6a7751fa7ad31702e389128c4d970324d0aa2cd.tar.gz rust-c6a7751fa7ad31702e389128c4d970324d0aa2cd.zip | |
Handle changed InstrProfilingRuntime path
Diffstat (limited to 'src/libprofiler_builtins')
| -rw-r--r-- | src/libprofiler_builtins/build.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libprofiler_builtins/build.rs b/src/libprofiler_builtins/build.rs index 852b7aac359..8adcff67800 100644 --- a/src/libprofiler_builtins/build.rs +++ b/src/libprofiler_builtins/build.rs @@ -21,7 +21,6 @@ fn main() { "InstrProfilingPlatformLinux.c", "InstrProfilingPlatformOther.c", "InstrProfilingPlatformWindows.c", - "InstrProfilingRuntime.cc", "InstrProfilingUtil.c", "InstrProfilingValue.c", "InstrProfilingWriter.c", @@ -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"); |
