Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 152181 - media-libs/mesa-6.5.1-r1 with nptl breaks PIC
Summary: media-libs/mesa-6.5.1-r1 with nptl breaks PIC
Status: RESOLVED DUPLICATE of bug 136115
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-20 19:05 UTC by Arthur Hagen
Modified: 2006-10-21 11:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Hagen 2006-10-20 19:05:25 UTC
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
Comment 1 Joshua Baergen (RETIRED) gentoo-dev 2006-10-21 11:49:24 UTC
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 ***