[llvm-bugs] [Bug 39782] New: cc1as breaks hard-linked cache entries of ccache

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Nov 25 20:35:18 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=39782

            Bug ID: 39782
           Summary: cc1as breaks hard-linked cache entries of ccache
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mail+llvm at tzik.jp
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

As cc1as overwrites the output file without using a temporary file, it breaks
hard-linked cache entries of ccache. Here is the corresponding ccache issue:
https://github.com/ccache/ccache/issues/331

That is, `cmp bar.o baz.o` at the last line of below should not hit.

 echo '.octa 0x0' | clang -cc1as -triple x86_64-pc-linux-gnu - -o foo.o
 ln -f foo.o bar.o
 cp foo.o baz.o
 echo '.octa 0x1' | clang -cc1as -triple x86_64-pc-linux-gnu - -o foo.o
 cmp bar.o baz.o


cc1as opens the file directly here[1], while other tools uses the temp file
through CompilerInstance[2]. 
[1]:
https://github.com/llvm-mirror/clang/blob/ae4b8efe92f4f30b36da73166ac89a7dc50ba917/tools/driver/cc1as_main.cpp#L348
[2]:
https://github.com/llvm-mirror/clang/blob/ae4b8efe92f4f30b36da73166ac89a7dc50ba917/lib/Frontend/CompilerInstance.cpp#L768

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181126/7edeebe7/attachment.html>


More information about the llvm-bugs mailing list