[BOLT] Fix value invalidation bug in runtimelib

Summary:
We can't use a fragment of the old LibPath as an input
to create a new one.

(cherry picked from FBD27642728)
This commit is contained in:
Rafael Auler 2021-04-07 21:40:23 -07:00 committed by Maksim Panchenko
parent 35732d954b
commit dc2673a039
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ std::string RuntimeLibrary::getLibPath(StringRef ToolPath,
// In some cases we install bolt binary into one level deeper in bin/,
// we need to go back one more level to find lib directory.
LibPath =
llvm::sys::path::parent_path(llvm::sys::path::parent_path(LibPath));
llvm::sys::path::parent_path(llvm::sys::path::parent_path(Dir));
llvm::sys::path::append(LibPath, "lib");
}
llvm::sys::path::append(LibPath, LibFileName);