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: unassignedclangb...@nondot.org
          Reporter: mail+l...@tzik.jp
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to