<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </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 - Fix build in glibc-based BSD systems"
   href="https://bugs.webkit.org/show_bug.cgi?id=156533">156533</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Fix build in glibc-based BSD systems
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Minor
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>berto&#64;igalia.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In MachineStackMarker.cpp there's a number of #ifdef blocks that follow this pattern:

#if OS(DARWIN)
  /* ... */
#elif OS(WINDOWS)
  /* ... */
#elif defined(__GLIBC__)
  /* ... */
#elif OS(FREEBSD)
  /* ... */
#else
#error Need a way to get the frame pointer for another thread on this platform
#endif

This works fine in most cases except in glibc-based FreeBSD systems (Debian GNU/kFreeBSD):

Source/JavaScriptCore/heap/MachineStackMarker.cpp: In member function 'void* JSC::MachineThreads::Thread::Registers::stackPointer() const':
Source/JavaScriptCore/heap/MachineStackMarker.cpp:554:68: error: 'const struct mcontext_t' has no member named 'gregs'                                        
     return reinterpret_cast&lt;void*&gt;((uintptr_t) regs.machineContext.gregs[REG_RSP]);

These systems should use the code inside the OS(FREEBSD) block, so this problem can be trivially solved by swapping the last two #elif blocks.</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>