Compiling mesa with nptl as a useflag enables TLS, which causes a conditional in src/mesa/x86/glapi_x86.S to be assembled: #ifdef GLX_USE_TLS GLOBL GLNAME(_x86_get_dispatch) HIDDEN(GLNAME(_x86_get_dispatch)) ALIGNTEXT16 GLNAME(_x86_get_dispatch): movl %gs:_glapi_tls_Dispatch@NTPOFF, %eax ret #elif defined(PTHREADS) The movl line breaks PIC for OpenGL.so.1.2 (and thus both prelink and hardened). This can probably be done through a GOT offset, and intermediate use of a different register than eax. Since I don't do x86 assembly and barely do disassembly, I have no proposed fix myself - I'll leave that to those in the know. Workaround: echo "media-libs/mesa -nptl" >>/etc/portage/package.use emerge --oneshot mesa
This is a known problem. I haven't seen any activity on the upstream bug in a while (https://bugs.freedesktop.org/show_bug.cgi?id=7459). I agree with your proposed solution, but I don't really do x86 assembly either. There might be a good reason why they didn't use GOT, but that probably can't be assumed. *** This bug has been marked as a duplicate of 136115 ***