forked from OSchip/llvm-project
Add the hostname to the module hash to avoid sharing between hosts
Sharing between hosts will cause problems for the LockFileManager, which can timeout waiting for a process that has already died. llvm-svn: 228592
This commit is contained in:
parent
38b2591469
commit
d072eea5d6
|
@ -2021,6 +2021,16 @@ std::string CompilerInvocation::getModuleHash() const {
|
|||
}
|
||||
}
|
||||
|
||||
#if LLVM_ON_UNIX
|
||||
// The LockFileManager cannot tell when processes from another host are
|
||||
// running, so mangle the hostname in to the module hash to separate them.
|
||||
char hostname[256];
|
||||
hostname[255] = 0;
|
||||
hostname[0] = 0;
|
||||
gethostname(hostname, 255);
|
||||
code = hash_combine(code, StringRef(hostname));
|
||||
#endif
|
||||
|
||||
return llvm::APInt(64, code).toString(36, /*Signed=*/false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue