<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 --- - pthread refactor (r268734) broke threading on OpenIndiana (__sun__)"
   href="https://llvm.org/bugs/show_bug.cgi?id=27677">27677</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>pthread refactor (r268734) broke threading on OpenIndiana (__sun__)
          </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>Solaris
          </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>mgorny@gentoo.org
          </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>The pthread refactor code in r268734 added the following conditional:

// Thread API
#ifndef _LIBCPP_HAS_NO_THREADS
# if defined(__FreeBSD__) || \
    defined(__NetBSD__) || \
    defined(__linux__) || \
    defined(__APPLE__) || \
    defined(__CloudABI__)
#  define _LIBCPP_THREAD_API_PTHREAD
# else
#  error "No thread API"
# endif // _LIBCPP_THREAD_API
#endif // _LIBCPP_HAS_NO_THREADS


This means that having threading support enabled results in build failure on
OpenIndiana (Solaris).

The easy way out would to be to add __sun__ to the above list of defines. I
think that would be fine if libc++ doesn't intend to support Solaris threads
anytime soon.

The hard way would probably be to use something like:

  (defined(__sun__) && defined(_PTHREADS))

which is the common indicator that POSIX threads are being requested. The
latter define is set by 'gcc -pthread' and 'pathcc -pthread'. However, in order
to have that working correctly you would have to actually pass '-pthread' to
the compiler rather than '-lpthread' that is being passed now.</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>