[Mesa-dev] [Bug 108541] Convert x86 assembly stub to PIC to fix linking with lld

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Oct 24 17:38:19 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=108541

            Bug ID: 108541
           Summary: Convert x86 assembly stub to PIC to fix linking with
                    lld
           Product: Mesa
           Version: unspecified
          Hardware: Other
                OS: OpenBSD
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: naddy at mips.inka.de
        QA Contact: mesa-dev at lists.freedesktop.org

Created attachment 142177
  --> https://bugs.freedesktop.org/attachment.cgi?id=142177&action=edit
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
>>> defined in .libs/shared_glapi_libglapi_la-u_current.o
>>> referenced by entry.c
>>>               .libs/shared_glapi_libglapi_la-entry.o:(.text+0x1)

The accompanying minimal diff remedies this by generating PIC code.  This is
mostly copied from the neighboring entry_x86_tls.h.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181024/beb957a6/attachment.html>


More information about the mesa-dev mailing list