r228592 - Add the hostname to the module hash to avoid sharing between hosts

Ben Langmuir blangmuir at apple.com
Mon Feb 9 11:40:23 PST 2015


I already fixed it (r228594), sorry for the noise.

Ben

> On Feb 9, 2015, at 11:40 AM, Juergen Ributzka <juergen at apple.com> wrote:
> 
> Hi Ben,
> 
> this broke the build: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/5302/consoleFull#-143024398849ba4694-19c4-4d7e-bec5-911270d8a58c <http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/5302/consoleFull#-143024398849ba4694-19c4-4d7e-bec5-911270d8a58c>
> 
> Could you please take a look?
> 
> Thanks
> 
> —Juergen
> 
> 
>> On Feb 9, 2015, at 11:23 AM, Ben Langmuir <blangmuir at apple.com <mailto:blangmuir at apple.com>> wrote:
>> 
>> Author: benlangmuir
>> Date: Mon Feb  9 13:23:08 2015
>> New Revision: 228592
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=228592&view=rev <http://llvm.org/viewvc/llvm-project?rev=228592&view=rev>
>> Log:
>> 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.
>> 
>> Modified:
>>    cfe/trunk/lib/Frontend/CompilerInvocation.cpp
>> 
>> Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=228592&r1=228591&r2=228592&view=diff <http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=228592&r1=228591&r2=228592&view=diff>
>> ==============================================================================
>> --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
>> +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Feb  9 13:23:08 2015
>> @@ -2021,6 +2021,16 @@ std::string CompilerInvocation::getModul
>>     }
>>   }
>> 
>> +#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);
>> }
>> 
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150209/b3416abe/attachment.html>


More information about the cfe-commits mailing list