<html>
    <head>
      <base href="https://bugs.freedesktop.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 - Convert x86 assembly stub to PIC to fix linking with lld"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=108541">108541</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Convert x86 assembly stub to PIC to fix linking with lld
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>OpenBSD
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>naddy@mips.inka.de
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=142177" name="attach_142177" title="Convert entry_x86_tsd.h to PIC">attachment 142177</a> <a href="attachment.cgi?id=142177&action=edit" title="Convert entry_x86_tsd.h to PIC">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=108541&attachment=142177'>[review]</a>
Convert entry_x86_tsd.h to PIC

The x86 assembly language stub in src/mapi/entry_x86_tsd.h does not generate
PIC (position-independent code). This causes text relocations, which are by
default treated as an error by LLVM's lld linker (now used by FreeBSD and
OpenBSD) when building a shared library.

/usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol:
_glapi_Dispatch in readonly segment; recompile object files with -fPIC
<span class="quote">>>> defined in .libs/shared_glapi_libglapi_la-u_current.o
>>> referenced by entry.c
>>>               .libs/shared_glapi_libglapi_la-entry.o:(.text+0x1)</span >

The accompanying minimal diff remedies this by generating PIC code.  This is
mostly copied from the neighboring entry_x86_tls.h.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>