Bug 2072

Summary: On sparc linux, if dlloader is used, programs/Xserver/GL will not build becauseLargePositionIndependentCFlags is not defined
Product: xorg Reporter: Ferris McCormick <fmccor>
Component: Server/DDX/Xorg/dlloaderAssignee: Adam Jackson <ajax>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: alan.coopersmith, dberkholz, roland.mainz
Version: 6.8.0   
Hardware: SPARC   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch to define LargePositionIndependentCFlage
none
large-pic-flags-for-linux-sparc-1.patch
none
/xorg/patches/large-pic-flags-for-linux-sparc-2.patch none

Description Ferris McCormick 2004-12-13 05:52:54 UTC
If you build xorg-x11 for Sparc Linux and require the dlloader, Mesa
(programs/Xserver/GL)
does not build because LargePositionIndependentCFlags never gets defined for the
combination sparc+linux.  It needs to be defined as
#define LargePositionIndependentCFlags -fPIC

This patch fixes it, although I cannot say that where I have put it is the best
place for it.
==============================
--- config/cf/xorg.cf-  2004-09-03 22:00:10.000000000 +0000
+++ config/cf/xorg.cf   2004-12-13 13:33:47.000000000 +0000
@@ -512,6 +512,11 @@
 
 #endif
 
+
+#ifndef LargePositionIndependentCFlags
+#define LargePositionIndependentCFlags -fPIC
+#endif
+
 /* Sparc64 Drivers */
 #if defined(OpenBSDArchitecture) && defined(Sparc64Architecture)
 /* Amiga framebuffer module */
Comment 1 Ferris McCormick 2004-12-13 05:56:29 UTC
Created attachment 1536 [details] [review]
Patch to define LargePositionIndependentCFlage

Patch to define LargePositionIndependentCFlags applied to vanilla xorg.cf.
Identical to the patch as written out in the original description.
Comment 2 Ferris McCormick 2004-12-13 06:39:04 UTC
For completeness, here is a cross reference to a very long discussion of xorg on
Sparc Linux.
http://bugs.gentoo.org/show_bug.cgi?id=61063
Comment 3 Adam Jackson 2004-12-13 12:32:14 UTC
Created attachment 1540 [details] [review]
large-pic-flags-for-linux-sparc-1.patch

probably this should go in linux.cf instead.  can you try this patch?

compiler flag definitions usually shouldn't go in xorg.cf since we don't know
what compiler is being used.  whereas in linux.cf we can pretty well assert
that we're using gcc.
Comment 4 Ferris McCormick 2004-12-13 13:30:26 UTC
I'll verify it tomorrow.  The reason I put the patch in xorg.cf rather than in
linux.cf is that I didn't think the problem was specific to linux (it's really
xorg-on-sparc-but-not-solaris-and-sun-compiler, I think.  But I don't know if
that resuces to linux or not.)
Comment 5 Ferris McCormick 2004-12-14 05:14:52 UTC
Patch 1540 (Put the define into linux.cf if no previous definition) works fine.
(And for me, it does not matter where it goes.)
Comment 6 Adam Jackson 2005-03-09 09:51:17 UTC
Created attachment 2062 [details] [review]
/xorg/patches/large-pic-flags-for-linux-sparc-2.patch

yeah, you're probably right.  however i'd prefer to wrap this in a check for
gcc too, since sun C uses -KPIC for this and redefinition warnings are ugly. 
give this one a shot and i'll check it in.

sorry for the lag on this one...
Comment 7 Ferris McCormick 2005-04-10 07:23:25 UTC
Patch works fine.  I just did a standard Gentoo unpack for xorg-x11-6.8.2-r1,
removed the existing patch to fix this problem,
and applied the large...-sparc-2.patch by hand.  After that, everything gets
configured correctly.
Specifically, xc/programs/Xserver/GL has '-fPIC' instead of the dangling
LargePosition... that you get if LargePosition... is not defined correctly.

Comment 8 Adam Jackson 2005-04-23 18:35:20 UTC
applied to head, 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.