<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Redefinition errors from double header inclusion on timestamp stale PCH files with -fno-validate-pch"
   href="https://bugs.llvm.org/show_bug.cgi?id=38600">38600</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Redefinition errors from double header inclusion on timestamp stale PCH files with -fno-validate-pch
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>keith@snap.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20732" name="attach_20732" title="Example App and script to reproduce the bug.">attachment 20732</a> <a href="attachment.cgi?id=20732&action=edit" title="Example App and script to reproduce the bug.">[details]</a></span>
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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>