Bug 2072 - On sparc linux, if dlloader is used, programs/Xserver/GL will not build becauseLargePositionIndependentCFlags is not defined
Summary: On sparc linux, if dlloader is used, programs/Xserver/GL will not build becau...
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xorg/dlloader (show other bugs)
Version: 6.8.0
Hardware: SPARC Linux (All)
: high normal
Assignee: Adam Jackson
QA Contact:
Depends on:
Reported: 2004-12-13 05:52 UTC by Ferris McCormick
Modified: 2005-04-23 01:35 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:

Patch to define LargePositionIndependentCFlage (369 bytes, patch)
2004-12-13 05:56 UTC, Ferris McCormick
no flags Details | Splinter Review
large-pic-flags-for-linux-sparc-1.patch (669 bytes, patch)
2004-12-13 12:32 UTC, Adam Jackson
no flags Details | Splinter Review
/xorg/patches/large-pic-flags-for-linux-sparc-2.patch (551 bytes, patch)
2005-03-09 09:51 UTC, Adam Jackson
no flags Details | Splinter Review

Description Ferris McCormick 2004-12-13 05:52:54 UTC
If you build xorg-x11 for Sparc Linux and require the dlloader, Mesa
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 @@
+#ifndef LargePositionIndependentCFlags
+#define LargePositionIndependentCFlags -fPIC
 /* 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.
Comment 3 Adam Jackson 2004-12-13 12:32:14 UTC
Created attachment 1540 [details] [review]

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]

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.