Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 110840

Summary: media-libs/mesa for X modular needs new USE flag, for -fPIC and prelink
Product: Gentoo Linux Reporter: Samuli Suominen (RETIRED) <ssuominen>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Severity: minor CC: wbrana
Priority: Highest    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 112004    

Description Samuli Suominen (RETIRED) gentoo-dev 2005-10-29 15:01:59 UTC
In Mesa sources, there is configs/linux-dri and configs/linux-dri-x86 , and one 
of them resets PIC_FLAGS = and another has PIC_FLAGS  = -fPIC , and starting of 
opengl applications indeed is slower if -fPIC isn't used. Not a biggie, but I 
still think there could be USE flag "pic" for Mesa that sets this or not, for 
people that wants to still use it. prelink -amR of course complains if that 
isn't used,  like.. a LOT, since many applications use

Reproducible: Always
Steps to Reproduce:
Comment 1 Joshua Baergen (RETIRED) gentoo-dev 2005-10-29 15:17:28 UTC
I'm assuming these are the upstream files.  Which one sets -fPIC?
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2005-10-29 15:19:36 UTC
Actually PIC slowed things down for libGL, which is the reason it isn't used.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2005-10-29 15:25:05 UTC
I don't see any slowdown, and prelink stopped complaining.

configs/linux-dri sets -fPIC
configs/linux-dri-x86 unsets -fPIC

Yes, upstream files.
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2005-10-29 15:27:52 UTC
(In reply to comment #3)
> I don't see any slowdown, and prelink stopped complaining.

I assume by "see" you mean you didn't do any actual testing with numbers to
compare. And no, glxgears doesn't count.
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2005-10-29 15:41:49 UTC
No I don't have glxgears installed, as it isn't even modularized yet.
I mean UT2004 gaming FPS. it's same. Starting of OpenGL application
seems a bit faster, like game called neverball. I used to compile
these from upstream by hand with -fPIC and to be honest I didn't even
notice it was "missing" now, until prelink flooded my terminal with
"Cannot prelink against non-PIC shared library"
Comment 6 Donnie Berkholz (RETIRED) gentoo-dev 2005-10-29 16:11:50 UTC
Yes prelink will make starting faster, but I'm talking about runtime.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2005-10-29 16:23:29 UTC
We could go on and on about that, and get no one to provide decent benchmarking 
information. :)

But it would be pretty trivial to add that USE into mesa ebuild..


if use pic; then
                echo "PIC_FLAGS = -fPIC" >> ${HOSTCONF}
                echo "PIC FLAGS =" >> ${HOSTCONF}


..for people loving fast startup times :)
Comment 8 Joshua Baergen (RETIRED) gentoo-dev 2005-11-16 08:20:34 UTC
Mesa is technically part of the modular release, so we can leave it on the
modular tracker.
Comment 9 Joshua Baergen (RETIRED) gentoo-dev 2005-11-28 17:01:09 UTC
I asked Adam Jackson about this today:

< ajax> i've seen a lot of numbers saying PIC is no slower, and very 
              little saying it
< ajax> 's faster
< ajax> the assembly dispatch takes care of >99% of the 
              performance problems that non-PIC libGL is supposed to solve
< ajax> if anyone complains, please point them to me, preferably 
              with testcase and numbers in hand

He quite strongly recommended to force PIC on. If there are no objections we may
as well do this.
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2005-11-30 12:35:42 UTC
It's got -fPIC by default in 6.4.1.
Comment 11 wbrana 2006-12-29 05:01:25 UTC
-fPIC didn't solve prelinking:
prelink: /usr/bin/glxgears: Cannot prelink against non-PIC shared library /usr/lib/opengl/xorg-x11/lib/
-fno-PIC should be optional with use flag.
Comment 12 Luca Guglielmetti 2007-06-05 23:10:47 UTC
I still have this problem by running "prelink -amR" (Cannot prelink against non-PIC shared library
A workaround is to compile media-libs/mesa with "-nptl": are this bug and/or bug #136115 really fixed?