<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 --- - [PATCH] fix potential FreeBSD build problem (<pthread_np.h> not included)"
   href="http://llvm.org/bugs/show_bug.cgi?id=16447">16447</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[PATCH] fix potential FreeBSD build problem (<pthread_np.h> not included)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </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>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rmh@gnu.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>sylvestre@debian.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10761" name="attach_10761" title="patch">attachment 10761</a> <a href="attachment.cgi?id=10761&action=edit" title="patch">[details]</a></span>
patch

Improper use of __FreeBSD_kernel__ in source/Host/common/Host.cpp excludes
FreeBSD from the code section it was intended for:

#elif defined (__linux__) || defined(__FreeBSD_kernel__)
[...]
#elif defined (__FreeBSD__)
[...]
#endif

Please note, that __FreeBSD_kernel__ implies a FreeBSD kernel, but it doesn't
imply anything about userland. So, when checking for this macro you may match
any system that uses the kernel of FreeBSD, including FreeBSD itself.

As recent versions of FreeBSD define this macro [1], the first code section is
being skipped, which doesn't look like what the original code intended.

A possible solution could be to split the logic for <sys/wait.h> (which is
basically kernel-related) from the logic for <pthread_np.h> (which is
determined by pthread library). See attachment.

[1] See <a href="http://svnweb.freebsd.org/base/head/sys/sys/param.h?view=co">http://svnweb.freebsd.org/base/head/sys/sys/param.h?view=co</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>