[llvm-bugs] [Bug 38600] New: Redefinition errors from double header inclusion on timestamp stale PCH files with -fno-validate-pch

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 16 09:08:34 PDT 2018


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

            Bug ID: 38600
           Summary: Redefinition errors from double header inclusion on
                    timestamp stale PCH files with -fno-validate-pch
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: keith at snap.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20732
  --> https://bugs.llvm.org/attachment.cgi?id=20732&action=edit
Example App and script to reproduce the bug.

Apple LLVM version 9.1.0 (clang-902.0.39.2)

-fno-validate-pch will bypass the timestamp validation on precompiled headers,
however clang can possibly double include these "stale" headers because of the
changed timestamp.   This breaks builds systems that rely on content
modification instead of timestamp modification (Buck/Bazel).
Example project attached.

/usr/bin/clang -x objective-c-header header-prefix.h -o header-prefix.h.gch
touch lib.h
/usr/bin/clang -x objective-c -include-pch header-prefix.h.gch main.m -o
main.m.o
#This normally fails because of a stale PCH
/usr/bin/clang -x objective-c -include-pch header-prefix.h.gch
-Wp,-fno-validate-pch main.m -o main.m.o
#This bypasses the timestamp check, but somewhere downstream includes the
header twice in the example for a redefinition error.

-- 
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/20180816/3c11d6b7/attachment.html>


More information about the llvm-bugs mailing list