Bug 1466 - [PATCH] selectable with/without PIC to build libGL on i386 Linux
Summary: [PATCH] selectable with/without PIC to build libGL on i386 Linux
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Ext/GLX (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high minor
Assignee: Xorg Project Team
QA Contact:
URL: http://hanzubon.jp/patches/xorg/selec...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-25 00:58 UTC by ISHIKAWA Mutsumi
Modified: 2005-10-20 19:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
patch to be selectable libGL with/without PIC flag on i386 Linux system (700 bytes, patch)
2004-09-25 00:59 UTC, ISHIKAWA Mutsumi
no flags Details | Splinter Review
libglx-pic-overridable.patch (489 bytes, patch)
2004-09-25 15:19 UTC, Adam Jackson
no flags Details | Splinter Review

Description ISHIKAWA Mutsumi 2004-09-25 00:58:03 UTC
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
Comment 1 ISHIKAWA Mutsumi 2004-09-25 00:59:40 UTC
Created attachment 968 [details] [review]
patch to be selectable libGL with/without PIC flag on i386 Linux system
Comment 2 Adam Jackson 2004-09-25 15:19:27 UTC
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.
Comment 3 ISHIKAWA Mutsumi 2004-09-25 23:32:59 UTC
(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 
 
 
 
 
 
Comment 4 Adam Jackson 2004-09-26 00:27:38 UTC
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.
Comment 5 Adam Jackson 2005-10-21 12:10:39 UTC
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.