on ix86 Linux, GLX force to build without PIC flag. --- xc/config/cf/linux.cf (line 365...) /* * Build shared libGL and the DRI modules without -fPIC on some architectures. * This improves performance. */ #if BuildXF86DRI # if defined(i386Architecture) # define BuildLibGlxWithoutPIC YES # endif #endif ---- So, if we wisth to build libGL with PIC on i386 Linux, we have to edit xc/config/cg/linux.cf directly. I think better to be able to select with/without PIC. For Debian package, Shared libraries must to be built with -fPIC option. It is describe in Debian policy #10.2. http://www.debian.org/doc/debian-policy/ch-files.html#s-libraries
Created attachment 968 [details] [review] patch to be selectable libGL with/without PIC flag on i386 Linux system
Created attachment 970 [details] [review] libglx-pic-overridable.patch the first patch is broken. BuildLibGlxWithoutPIC is always defined, so the '#ifndef BuildLibGlxWithoutPIC' stanza never has any effect. attached patch does it better, and distros may force a BuildLibGlxWithoutPIC setting in host.def. i'd also make a note at this point that the Debian policy is broken: "The shared version of a library must be compiled with -fPIC, and the static version must not be." this _will_ fail on amd64 when someone builds a DSO that links in code from a static library. on amd64 any object file that may find it's way into a DSO must be compiled with -fPIC. this is true of several other architectures, hppa and (i think) ia64 at least.
(In reply to comment #2) > the first patch is broken. BuildLibGlxWithoutPIC is always defined, so the > '#ifndef BuildLibGlxWithoutPIC' stanza never has any effect. Hum? I don't understand why it is always defined. 1st chunk of my patch will define BuildLibGlxWithoutPIC for only Debian GNU/Linux system. #if LinuxDistribution == LinuxDebian (.....) # define BuildLibGlxWithoutPIC NO (.....) #endif I believe this section has an effect only for Debian GNU/Linux. BuildLibGlxWithoutPIC is always defined for Debian GNU/Linux system only
d'oh, you're right, didn't read enough of the context. that looks good then, i'll go ahead and commit your patch if there are no other objections.
applied (finally), thanks!
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.