<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 --- - ppc64 (be and le) don't have a working std::call_once"
   href="https://llvm.org/bugs/show_bug.cgi?id=28024">28024</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ppc64 (be and le) don't have a working std::call_once
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Core LLVM classes
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>hfinkel@anl.gov, kbarton@ca.ibm.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This appears to be a bug in the libstdc++ implementation of std::call_once, but
it may be somewhat specific to ABI issues as there are differences between
stage1 and stage2 in LE.

Here are the build bot builds that started failing when I landed r271800 that
switch LLVM to use std::call_once on various implementations:
<a href="http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/1169">http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/1169</a>
<a href="http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/2703">http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/2703</a>

These fail in unit tests that use INITIALIZE_PASS which defines a function that
uses std::call_once. The failure happens when the implementation of
std::call_once throws std::system_error with the '-1' return of a call to
pthread_once. I don't know why pthread_once would fail here. I've tried to
reproduce any failure to properly initialize the std::once_flag (which contains
as a member the pthread_once_t variable passed to pthread_once) but to no avail
on my system.

Hopefully someone who works on PPC can figure this out.

Also, when I tried to disable this in r271821, it worked for ppc64le, and for
stage2 in ppc64be, but not for stage1 for some reason! Really weird:
<a href="http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/2707">http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/2707</a>

Again, I can't figure out how or why this would happen. Hopefully some PPC
folks can figure this out.</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>