Bug 1104

Summary: Xorg CVS head won't build on Solaris/sparc
Product: xorg Reporter: Alan Coopersmith <alan.coopersmith>
Component: Server/Ext/GLXAssignee: Alan Coopersmith <alan.coopersmith>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: high CC: ajax, kem
Version: git   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 351    
Attachments:
Description Flags
Patch to fix build on Solaris/SPARC
none
Updated patch none

Description Alan Coopersmith 2004-08-16 16:20:26 UTC
Attempting to build last night's CVS head on Solaris/sparc results in the
following errors:

making all in lib/GL/mesa/sparc...
rm -f sparc.o
cc -c -xO4 -xbuiltin=%all -xlibmil -xstrconst -xarch=v8plus  -Xa -v -zlazyload
-zcombreloc -xstrconst -xildoff  -I../../../../exports/include
-I../../../../include/extensions -I../../../../extras/Mesa/src 
-I../../../../extras/Mesa/src/SPARC  -I../../../include  -I../../../..
-I../../../../exports/include   -Dsun -Dsparc -DSVR4 -D__EXTENSIONS__    
-DMALLOC_0_RETURNS_NULL -DGLXEXT  -DGLX_USE_MESA
-D__GLX_ALIGN64 -DUSE_SPARC_ASM     -Kpic sparc.c
"sparc.c", line 32: cannot find include file: "context.h"
"sparc.c", line 33: cannot find include file: "math/m_xform.h"
"sparc.c", line 34: cannot find include file: "tnl/t_context.h"
"sparc.c", line 35: cannot find include file: "sparc.h"

/usr/ccs/lib/cpp -Dsun -Dsparc -DSVR4 -D__EXTENSIONS__   -DMALLOC_0_RETURNS_NULL
-DGLXEXT  -DGLX_USE_MESA -D__GLX_ALIGN64 -DUSE_SPARC_ASM
-I../../../../exports/include -I../../../../include/extensions
-I../../../../extras/Mesa/src  -I../../../../extras/Mesa/src/SPARC 
-I../../../include   xform.S | \
grep -v '^\#' > xform.i
"xform.S", line 19: Can't find include file sparc_matrix.h

/usr/ccs/lib/cpp -Dsun -Dsparc -DSVR4 -D__EXTENSIONS__   -DMALLOC_0_RETURNS_NULL
-DGLXEXT  -DGLX_USE_MESA -D__GLX_ALIGN64 -DUSE_SPARC_ASM
-I../../../../exports/include -I../../../../include/extensions
-I../../../../extras/Mesa/src  -I../../../../extras/Mesa/src/SPARC 
-I../../../include   norm.S | \
grep -v '^\#' > norm.i
"norm.S", line 3: Can't find include file sparc_matrix.h


cc -o libGLcore.so [....]
ld: fatal: too many symbols require `small' PIC references:
        have 5495, maximum 2048 -- recompile some modules -K PIC.
Comment 1 Alan Coopersmith 2004-08-16 16:30:32 UTC
Created attachment 654 [details] [review]
Patch to fix build on Solaris/SPARC

Add LargePICTable/PICFLAGS to GL Imakefiles as necessary

Add include paths to xc/lib/GL/mesa/src/SPARC/Imakefile that match the
similar code in xc/lib/GL/mesa/src/x86
Comment 2 Kevin E. Martin 2004-08-16 19:56:32 UTC
Took a look at your patch, and the issues that I'm concerned about are:

- #define LargePICTable YES shouldn't have any effect in the server-side
  Imakefiles since that define is only used in Library.tmpl, so are those
  defines really needed?
- Are these changes needed by only Solaris?  Will they cause any problems with
  Linux on SPARC?
Comment 3 Alan Coopersmith 2004-08-16 20:06:58 UTC
I included the defines out of habit - they probably aren't needed.

As for Linux on SPARC, I have no idea.  I have no Linux/SPARC machines around
to test with, nor do I know anyone who does.  It looks like it does not define
LargePositionIndependentCFlags but simply always uses the large PIC table flags.
I can change the patch to be '#if defined(SunArchitecture) &&
defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)' to prevent
issues there.
Comment 4 Kevin E. Martin 2004-08-16 21:42:30 UTC
(In reply to comment #3)
> As for Linux on SPARC, I have no idea.  I have no Linux/SPARC machines around
> to test with, nor do I know anyone who does.  It looks like it does not define
> LargePositionIndependentCFlags but simply always uses the large PIC table flags.
> I can change the patch to be '#if defined(SunArchitecture) &&
> defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)' to prevent
> issues there.

That would probably be safer to do.

After you've updated the patch and tested it out, please let me know and I'll
check in the changes.

Comment 5 Alan Coopersmith 2004-08-18 23:37:06 UTC
Created attachment 678 [details] [review]
Updated patch

Updated patch as discussed with Kevin 
Tested on Solaris sparc with both Sun cc and gcc
Comment 6 Kevin E. Martin 2004-08-19 00:34:51 UTC
Patch checked in.
Closing.
Comment 7 Adam Jackson 2004-08-21 21:58:29 UTC
*** Bug 1154 has been marked as a duplicate of this bug. ***

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.