<div dir="ltr">Takumi provides some more details on IRC: The change broke <a href="http://bb.pgr.jp/builders/bootstrap-clang-libcxx-lld-i686-linux/builds/655/steps/build_stage2/logs/stdio">http://bb.pgr.jp/builders/bootstrap-clang-libcxx-lld-i686-linux/builds/655/steps/build_stage2/logs/stdio</a> , which uses modules.  He says there's a race-condition: while clang emits ***-{tmp}.pcm, another clang collects *.pcm for the module index. GlobalModuleIndex.cpp walks over a directory here and ignores everything not ending in '.pcm' here: <a href="http://llvm-cs.pcc.me.uk/tools/clang/lib/Serialization/GlobalModuleIndex.cpp#850">http://llvm-cs.pcc.me.uk/tools/clang/lib/Serialization/GlobalModuleIndex.cpp#850</a><div><br>That seems pretty gross, but I can't think of a non-gross way to make this patch work with that pcm walking.</div><div><br>We could always append ".tmp" to the temp file names, but then the original benefit is gone too.</div><div><br>We could do this patch only for .obj files, or always except for .pcm files, but that seems both kind of gross as well.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 4, 2017 at 2:35 AM, NAKAMURA Takumi via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: chapuni<br>
Date: Thu Aug  3 23:35:32 2017<br>
New Revision: 310030<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=310030&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=310030&view=rev</a><br>
Log:<br>
Revert r309984, "Use "foo-12345.o" instead of "foo.o-12345" as temporary file name."<br>
<br>
It generates MODULE-XXXXXXXXXXXX-%%%%%%%%.<wbr>pcm, then GlobalModuleIndex.cpp is confused with the suffix ".pcm"<br>
<br>
Modified:<br>
    cfe/trunk/lib/Frontend/<wbr>CompilerInstance.cpp<br>
<br>
Modified: cfe/trunk/lib/Frontend/<wbr>CompilerInstance.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=310030&r1=310029&r2=310030&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/<wbr>Frontend/CompilerInstance.cpp?<wbr>rev=310030&r1=310029&r2=<wbr>310030&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Frontend/<wbr>CompilerInstance.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/<wbr>CompilerInstance.cpp Thu Aug  3 23:35:32 2017<br>
@@ -759,13 +759,9 @@ std::unique_ptr<llvm::raw_<wbr>pwrite_stream><br>
<br>
   if (UseTemporary) {<br>
     // Create a temporary file.<br>
-    // Insert -%%%%%%%% before the extension (if any), so that tools doing<br>
-    // things based on the file extension do the right thing.<br>
-    StringRef OutputExtension = llvm::sys::path::extension(<wbr>OutFile);<br>
-    SmallString<128> TempPath =<br>
-        StringRef(OutFile).drop_back(<wbr>OutputExtension.size());<br>
+    SmallString<128> TempPath;<br>
+    TempPath = OutFile;<br>
     TempPath += "-%%%%%%%%";<br>
-    TempPath += OutputExtension;<br>
     int fd;<br>
     std::error_code EC =<br>
         llvm::sys::fs::<wbr>createUniqueFile(TempPath, fd, TempPath);<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>