<html>
    <head>
      <base href="http://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 --- - Missing __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 et al for non-x86/x64 architectures"
   href="http://llvm.org/bugs/show_bug.cgi?id=16917">16917</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Missing __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 et al for non-x86/x64 architectures
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.3
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </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>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>s_llvm@nedprod.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Here's an illustrative patch for the ARM driver, but I think one of these needs
to go into every architecture supporting CAS atomics:

--- a/tools/clang/lib/Basic/Targets.cpp
+++ b/tools/clang/lib/Basic/Targets.cpp
@@ -3819,6 +3859,15 @@ public:
     // when Neon instructions are actually available.
     if ((FPU & NeonFPU) && !SoftFloat && IsARMv7)
       Builder.defineMacro("__ARM_NEON__");
+    
+    // These need setting for every architecture I think, but I'll just patch
+    // for ARM now. See <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - libstdc++ std::thread, when compiled with clang, "pure virtual method called""
   href="show_bug.cgi?id=12730">http://llvm.org/bugs/show_bug.cgi?id=12730</a> for more
info.
+    if ('6' <= CPUArch[0]) {
+      Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
+      Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
+      Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
+      Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
+    }
   }
   virtual void getTargetBuiltins(const Builtin::Info *&Records,
                                  unsigned &NumRecords) const {

Related is <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - libstdc++ std::thread, when compiled with clang, "pure virtual method called""
   href="show_bug.cgi?id=12730#c13">http://llvm.org/bugs/show_bug.cgi?id=12730#c13</a>.

Niall</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>