Created attachment 142177 [details] [review] 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.
Created attachment 142297 [details] [review] adapted libglvnd x86 tsd changes
Your patch segfaults at runtime, an approach based on libglvnd x86 tsd changes seems to work however. https://github.com/NVIDIA/libglvnd/commit/9a17198be3622ffa00f9db36e6b55773d4dcf596#diff-ac251356bcfe8971786926ffc9660d69
FYI, I create a merge request on behalf of Jonathan Gray: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1974
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1032.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.