<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} p
        {margin-top:0;
        margin-bottom:0}--></style>
</head>
<body dir="ltr" style="font-size:10pt;color:#000000;background-color:#FFFFFF;font-family:Tahoma,Geneva,sans-serif;">
<p>Hi Folks,</p>
<p><br>
</p>
<p>I am building LLVM 3.9.1 using the Yocto build system for a cross build. The compiled bins/libs work totally fine on the target machine however there seems to be an intermittent race condition during the build which causes a build failure. On the failed
 builds I usually see things being linking/compiling twice e.g.</p>
<p><br>
</p>
<p><span style="color: rgb(0, 111, 201);">Linking CXX static library ../libLLVMSupport.a</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">cd build/NATIVE/lib/Support && /usr/bin/cmake -P CMakeFiles/LLVMSupport.dir/cmake_clean_target.cmake</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">cd build/NATIVE/lib/Support && /usr/bin/cmake -E cmake_link_script CMakeFiles/LLVMSupport.dir/link.txt --verbose=1</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">/usr/bin/ar qc ../libLLVMSupport.a  CMakeFiles/LLVMSupport.dir/APFloat.cpp.o CMakeFiles/LLVMSupport.dir/APInt.cpp.o CMakeFiles/LLVMSupport.dir/APSInt.cpp.o CMakeFiles/LLVMSupport.dir/ARMBuildAttrs.cpp.o CMakeFiles/LLVMSupport.dir/ARMWinEH.cpp.o
 CMakeFiles/LLVMSupport.dir/Allocator.cpp.o CMakeFiles/LLVMSupport.dir/BlockFrequency.cpp.o CMakeFiles/LLVMSupport.dir/BranchProbability.cpp.o CMakeFiles/LLVMSupport.dir/CachePruning.cpp.o CMakeFiles/LLVMSupport.dir/circular_raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/COM.cpp.o
 CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o CMakeFiles/LLVMSupport.dir/Compression.cpp.o CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.o CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o
 CMakeFiles/LLVMSupport.dir/DataStream.cpp.o CMakeFiles/LLVMSupport.dir/Debug.cpp.o CMakeFiles/LLVMSupport.dir/DeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/DAGDeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/Dwarf.cpp.o CMakeFiles/LLVMSupport.dir/Error.cpp.o
 CMakeFiles/LLVMSupport.dir/ErrorHandling.cpp.o CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.o CMakeFiles/LLVMSupport.dir/FileOutputBuffer.cpp.o CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o CMakeFiles/LLVMSupport.dir/FormattedStream.cpp.o CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o
 CMakeFiles/LLVMSupport.dir/Hashing.cpp.o CMakeFiles/LLVMSupport.dir/IntEqClasses.cpp.o CMakeFiles/LLVMSupport.dir/IntervalMap.cpp.o CMakeFiles/LLVMSupport.dir/IntrusiveRefCntPtr.cpp.o CMakeFiles/LLVMSupport.dir/JamCRC.cpp.o CMakeFiles/LLVMSupport.dir/LEB128.cpp.o
 CMakeFiles/LLVMSupport.dir/LineIterator.cpp.o CMakeFiles/LLVMSupport.dir/Locale.cpp.o CMakeFiles/LLVMSupport.dir/LockFileManager.cpp.o CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.o CMakeFiles/LLVMSupport.dir/MathExtras.cpp.o CMakeFiles/LLVMSupport.dir/MemoryBuffer.cpp.o
 CMakeFiles/LLVMSupport.dir/MemoryObject.cpp.o CMakeFiles/LLVMSupport.dir/MD5.cpp.o CMakeFiles/LLVMSupport.dir/Options.cpp.o CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o CMakeFiles/LLVMSupport.dir/PrettyStackTrace.cpp.o CMakeFiles/LLVMSupport.dir/RandomNumberGenerator.cpp.o
 CMakeFiles/LLVMSupport.dir/Regex.cpp.o CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o CMakeFiles/LLVMSupport.dir/ScopedPrinter.cpp.o CMakeFiles/LLVMSupport.dir/SHA1.cpp.o CMakeFiles/LLVMSupport.dir/SmallPtrSet.cpp.o CMakeFiles/LLVMSupport.dir/SmallVector.cpp.o
 CMakeFiles/LLVMSupport.dir/SourceMgr.cpp.o CMakeFiles/LLVMSupport.dir/SpecialCaseList.cpp.o CMakeFiles/LLVMSupport.dir/Statistic.cpp.o CMakeFiles/LLVMSupport.dir/StreamingMemoryObject.cpp.o CMakeFiles/LLVMSupport.dir/StringExtras.cpp.o CMakeFiles/LLVMSupport.dir/StringMap.cpp.o
 CMakeFiles/LLVMSupport.dir/StringPool.cpp.o CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o CMakeFiles/LLVMSupport.dir/StringRef.cpp.o CMakeFiles/LLVMSupport.dir/SystemUtils.cpp.o CMakeFiles/LLVMSupport.dir/TargetParser.cpp.o CMakeFiles/LLVMSupport.dir/ThreadPool.cpp.o
 CMakeFiles/LLVMSupport.dir/Timer.cpp.o CMakeFiles/LLVMSupport.dir/ToolOutputFile.cpp.o CMakeFiles/LLVMSupport.dir/Triple.cpp.o CMakeFiles/LLVMSupport.dir/Twine.cpp.o CMakeFiles/LLVMSupport.dir/Unicode.cpp.o CMakeFiles/LLVMSupport.dir/YAMLParser.cpp.o CMakeFiles/LLVMSupport.dir/YAMLTraits.cpp.o
 CMakeFiles/LLVMSupport.dir/raw_os_ostream.cpp.o CMakeFiles/LLVMSupport.dir/raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/regcomp.c.o CMakeFiles/LLVMSupport.dir/regerror.c.o CMakeFiles/LLVMSupport.dir/regexec.c.o CMakeFiles/LLVMSupport.dir/regfree.c.o CMakeFiles/LLVMSupport.dir/regstrlcpy.c.o
 CMakeFiles/LLVMSupport.dir/Atomic.cpp.o CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.o CMakeFiles/LLVMSupport.dir/Errno.cpp.o CMakeFiles/LLVMSupport.dir/Host.cpp.o CMakeFiles/LLVMSupport.dir/Memory.cpp.o CMakeFiles/LLVMSupport.dir/Mutex.cpp.o CMakeFiles/LLVMSupport.dir/Path.cpp.o
 CMakeFiles/LLVMSupport.dir/Process.cpp.o CMakeFiles/LLVMSupport.dir/Program.cpp.o CMakeFiles/LLVMSupport.dir/RWMutex.cpp.o CMakeFiles/LLVMSupport.dir/SearchForAddressOfSpecialSymbol.cpp.o CMakeFiles/LLVMSupport.dir/Signals.cpp.o CMakeFiles/LLVMSupport.dir/TargetRegistry.cpp.o
 CMakeFiles/LLVMSupport.dir/ThreadLocal.cpp.o CMakeFiles/LLVMSupport.dir/Threading.cpp.o CMakeFiles/LLVMSupport.dir/TimeValue.cpp.o CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">Linking CXX static library ../libLLVMSupport.a</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">cd build/NATIVE/lib/Support && /usr/bin/cmake -P CMakeFiles/LLVMSupport.dir/cmake_clean_target.cmake</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">cd build/NATIVE/lib/Support && /usr/bin/cmake -E cmake_link_script CMakeFiles/LLVMSupport.dir/link.txt --verbose=1</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">/usr/bin/ar qc ../libLLVMSupport.a  CMakeFiles/LLVMSupport.dir/APFloat.cpp.o CMakeFiles/LLVMSupport.dir/APInt.cpp.o CMakeFiles/LLVMSupport.dir/APSInt.cpp.o CMakeFiles/LLVMSupport.dir/ARMBuildAttrs.cpp.o CMakeFiles/LLVMSupport.dir/ARMWinEH.cpp.o
 CMakeFiles/LLVMSupport.dir/Allocator.cpp.o CMakeFiles/LLVMSupport.dir/BlockFrequency.cpp.o CMakeFiles/LLVMSupport.dir/BranchProbability.cpp.o CMakeFiles/LLVMSupport.dir/CachePruning.cpp.o CMakeFiles/LLVMSupport.dir/circular_raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/COM.cpp.o
 CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o CMakeFiles/LLVMSupport.dir/Compression.cpp.o CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.o CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o
 CMakeFiles/LLVMSupport.dir/DataStream.cpp.o CMakeFiles/LLVMSupport.dir/Debug.cpp.o CMakeFiles/LLVMSupport.dir/DeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/DAGDeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/Dwarf.cpp.o CMakeFiles/LLVMSupport.dir/Error.cpp.o
 CMakeFiles/LLVMSupport.dir/ErrorHandling.cpp.o CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.o CMakeFiles/LLVMSupport.dir/FileOutputBuffer.cpp.o CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o CMakeFiles/LLVMSupport.dir/FormattedStream.cpp.o CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o
 CMakeFiles/LLVMSupport.dir/Hashing.cpp.o CMakeFiles/LLVMSupport.dir/IntEqClasses.cpp.o CMakeFiles/LLVMSupport.dir/IntervalMap.cpp.o CMakeFiles/LLVMSupport.dir/IntrusiveRefCntPtr.cpp.o CMakeFiles/LLVMSupport.dir/JamCRC.cpp.o CMakeFiles/LLVMSupport.dir/LEB128.cpp.o
 CMakeFiles/LLVMSupport.dir/LineIterator.cpp.o CMakeFiles/LLVMSupport.dir/Locale.cpp.o CMakeFiles/LLVMSupport.dir/LockFileManager.cpp.o CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.o CMakeFiles/LLVMSupport.dir/MathExtras.cpp.o CMakeFiles/LLVMSupport.dir/MemoryBuffer.cpp.o
 CMakeFiles/LLVMSupport.dir/MemoryObject.cpp.o CMakeFiles/LLVMSupport.dir/MD5.cpp.o CMakeFiles/LLVMSupport.dir/Options.cpp.o CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o CMakeFiles/LLVMSupport.dir/PrettyStackTrace.cpp.o CMakeFiles/LLVMSupport.dir/RandomNumberGenerator.cpp.o
 CMakeFiles/LLVMSupport.dir/Regex.cpp.o CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o CMakeFiles/LLVMSupport.dir/ScopedPrinter.cpp.o CMakeFiles/LLVMSupport.dir/SHA1.cpp.o CMakeFiles/LLVMSupport.dir/SmallPtrSet.cpp.o CMakeFiles/LLVMSupport.dir/SmallVector.cpp.o
 CMakeFiles/LLVMSupport.dir/SourceMgr.cpp.o CMakeFiles/LLVMSupport.dir/SpecialCaseList.cpp.o CMakeFiles/LLVMSupport.dir/Statistic.cpp.o CMakeFiles/LLVMSupport.dir/StreamingMemoryObject.cpp.o CMakeFiles/LLVMSupport.dir/StringExtras.cpp.o CMakeFiles/LLVMSupport.dir/StringMap.cpp.o
 CMakeFiles/LLVMSupport.dir/StringPool.cpp.o CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o CMakeFiles/LLVMSupport.dir/StringRef.cpp.o CMakeFiles/LLVMSupport.dir/SystemUtils.cpp.o CMakeFiles/LLVMSupport.dir/TargetParser.cpp.o CMakeFiles/LLVMSupport.dir/ThreadPool.cpp.o
 CMakeFiles/LLVMSupport.dir/Timer.cpp.o CMakeFiles/LLVMSupport.dir/ToolOutputFile.cpp.o CMakeFiles/LLVMSupport.dir/Triple.cpp.o CMakeFiles/LLVMSupport.dir/Twine.cpp.o CMakeFiles/LLVMSupport.dir/Unicode.cpp.o CMakeFiles/LLVMSupport.dir/YAMLParser.cpp.o CMakeFiles/LLVMSupport.dir/YAMLTraits.cpp.o
 CMakeFiles/LLVMSupport.dir/raw_os_ostream.cpp.o CMakeFiles/LLVMSupport.dir/raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/regcomp.c.o CMakeFiles/LLVMSupport.dir/regerror.c.o CMakeFiles/LLVMSupport.dir/regexec.c.o CMakeFiles/LLVMSupport.dir/regfree.c.o CMakeFiles/LLVMSupport.dir/regstrlcpy.c.o
 CMakeFiles/LLVMSupport.dir/Atomic.cpp.o CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.o CMakeFiles/LLVMSupport.dir/Errno.cpp.o CMakeFiles/LLVMSupport.dir/Host.cpp.o CMakeFiles/LLVMSupport.dir/Memory.cpp.o CMakeFiles/LLVMSupport.dir/Mutex.cpp.o CMakeFiles/LLVMSupport.dir/Path.cpp.o
 CMakeFiles/LLVMSupport.dir/Process.cpp.o CMakeFiles/LLVMSupport.dir/Program.cpp.o CMakeFiles/LLVMSupport.dir/RWMutex.cpp.o CMakeFiles/LLVMSupport.dir/SearchForAddressOfSpecialSymbol.cpp.o CMakeFiles/LLVMSupport.dir/Signals.cpp.o CMakeFiles/LLVMSupport.dir/TargetRegistry.cpp.o
 CMakeFiles/LLVMSupport.dir/ThreadLocal.cpp.o CMakeFiles/LLVMSupport.dir/Threading.cpp.o CMakeFiles/LLVMSupport.dir/TimeValue.cpp.o CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">/usr/bin/ranlib ../libLLVMSupport.a</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">/usr/bin/ranlib ../libLLVMSupport.a</span></p>
<p><br>
</p>
<p>Sorry for the clutter here... :(</p>
<p>and from the above mentioned example the build failed with</p>
<p><br>
</p>
<p><span style="color: rgb(0, 111, 201);">../../lib/libLLVMSupport.a(Process.cpp.o): In function `llvm::sys::Process::GetRandomNumber()':</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">Process.cpp:(.text._ZN4llvm3sys7Process15GetRandomNumberEv+0x70): undefined reference to `llvm::sys::TimeValue::now()'</span><br style="color: rgb(0, 111, 201);">
<span style="color: rgb(0, 111, 201);">collect2: error: ld returned 1 exit status</span><br>
</p>
<p><br>
</p>
<p>I also see exactly 4 instances of "<span style="color: rgb(0, 111, 201);">warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.</span>" and this was reported at
<a href="https://llvm.org/bugs/show_bug.cgi?format=multiple&id=23328">https://llvm.org/bugs/show_bug.cgi?format=multiple&id=23328</a> quite some time ago. Has there been any movement on this? Can the mentioned warning cause such a trouble? I doubt that because
 the warning appears in successful builds as well but I'd love to hear expert opinion on this.<br>
</p>
<p><br>
</p>
<p>NATIVE builds are done for the host which is then utilized for generating the target binaries, correct? If that is so, what can cause multiple builds for the NATIVE system?</p>
<p><br>
</p>
<p>We're building with CMake with the "Unix Makefiles" generator prior to this we were building 3.7.1 using autotools and never saw such an issue. GCC version is 5.4.0 on both instances with GNU Make at 4.1. Any pointers/help would be highly appreciated.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div style="font-family:Tahoma; font-size:13px"><font face="Tahoma"></font>
<div style="font-size:13px">
<div><font size="2" face="Tahoma"><span lang="en-US">
<div style="margin:0">BR,</div>
<div style="margin:0"><i>Awais</i></div>
</span></font></div>
</div>
<font face="Tahoma"></font></div>
</div>
</body>
</html>