<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - CMake atomic check fails, missing include"
   href="https://llvm.org/bugs/show_bug.cgi?id=26631">26631</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CMake atomic check fails, missing include
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rianquinn@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I am working with a GCC cross compiler (x86_64-elf), and CMake fails the atomic
check because it cannot find the includes for libc++ (as they have not been
installed into the sysroot yet.... chicken / egg problem). 

"fatal error: cstdint: No such file or directory"

If you look at the code that it is trying to compile, you can see that it uses
these includes:

#include <cstdint>
#include <atomic>
std::atomic<uintptr_t> x;
std::atomic<uintmax_t> y;
int main() {
  return x + y;
}

The problem is, the GCC compiler was never given a "-I" for the include folder
that has these. To fix this issue, I have temporarily added the -I to point to
the libcxx repo that I am building with, and it works fine. Once it's done
compiling libcxx, it installs the all of the headers as expected into the
sysroot. 

Seems to me... the CMake script should be patched to add it's own include
folder so that it can find the headers it's attempting to use.</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>