Subject: X11R6 and SunPro C++ 4.0

From: [email-masked] (Juergen Zimmermann)
Date: 19 May 1994 18:16:43 GMT

Hi,

I tried to compile X11R6 with SunPro C++ 4.0 under Solaris 2.3 but failed wrt Fresco:

making all in workInProgress/Fresco...
making all in workInProgress/Fresco/src...
rm -f libFresco.so.0.7~
(cd .; LD_RUN_PATH=/tools/scratch/x11r6/lib; CC -o ./libFresco.so.0.7~ -G -z text -h libFresco.so.0.7 Sdisplay.o  Sdrawing.o  Sfigures.o  Sglyphs.o  Slayouts.o  Stypes.o  Sviewers.o  Swidgets.o  Xdisplay.o  Xdrawing.o  Xraster.o  Xwindow.o  figures.o  fresco.o  glyphs.o  inits.o  layouts.o  objects.o  os.o  ox-ids.o  threads.o  transport.o  types.o  viewers.o  widgets.o )
Text relocation remains			      referenced
    against symbol		    offset	in file
<unknown>                           0x14      	Sdisplay.o
__0oOXfFrescoObjectctv              0x18      	Sdisplay.o
...

My settings in site.def are:
#define ProjectRoot /tools/scratch/x11r6
#define HasCodeCenter   NO
#define ArCmd        CC -xar -o
#define BourneShell  /sbin/sh
#define CcCmd        cc  
#define CCompilerMajorVersion 3
#define CplusplusCmd CC
#define CplusplusCompilerMajorVersion 4
#define CppCmd       /usr/ccs/lib/cpp
#define DoRanlibCmd  NO
#define GetValuesBC  YES
#define HasCplusplus YES
#define LdCmd        CC  

Any hint is appreciated. Thank you in advance!

Regards,
Juergen

______________________________________________________________________
Juergen Zimmermann         phone:  +49 6151 16 6841
Technical University       fax:    +49 6151 16 5554
Dept. of Computer Science  email:  [email-masked]
Frankfurter Str. 69a       finger: [email-masked]
D-64293 Darmstadt
Germany

---

From: [email-masked] (Blair Zajac)
Date: 19 May 1994 20:50:03 GMT

Juergen Zimmermann ([email-masked]) wrote:

: Hi,

: I tried to compile X11R6 with SunPro C++ 4.0 under Solaris 2.3
: but failed wrt Fresco:

: making all in workInProgress/Fresco...
: making all in workInProgress/Fresco/src...
: rm -f libFresco.so.0.7~
: (cd .; LD_RUN_PATH=/tools/scratch/x11r6/lib; CC -o ./libFresco.so.0.7~ -G
:  -z text -h libFresco.so.0.7 Sdisplay.o  Sdrawing.o  Sfigures.o  Sglyphs.o
:   Slayouts.o  Stypes.o  Sviewers.o  Swidgets.o  Xdisplay.o  Xdrawing.o
:   Xraster.o  Xwindow.o  figures.o  fresco.o  glyphs.o  inits.o  layouts.o
:   objects.o  os.o  ox-ids.o  threads.o  transport.o  types.o  viewers.o:
   widgets.o )
: Text relocation remains			      referenced
:     against symbol		    offset	in file
: <unknown>                           0x14      	Sdisplay.o
: __0oOXfFrescoObjectctv              0x18      	Sdisplay.o
: ...

: My settings in site.def are:
: #define ProjectRoot /tools/scratch/x11r6
: #define HasCodeCenter   NO
: #define ArCmd        CC -xar -o
: #define BourneShell  /sbin/sh
: #define CcCmd        cc  
: #define CCompilerMajorVersion 3
: #define CplusplusCmd CC
: #define CplusplusCompilerMajorVersion 4
: #define CppCmd       /usr/ccs/lib/cpp
: #define DoRanlibCmd  NO
: #define GetValuesBC  YES
: #define HasCplusplus YES
: #define LdCmd        CC  

: Any hint is appreciated. Thank you in advance!

: Regards,
: Juergen

I think the problem is your definition of LdCmd.  Looking at my make
log, libFresco was built like this:

(cd .; LD_RUN_PATH=/opt/x11r6/lib /usr/ccs/bin/ld -o
./libFresco.so.0.7~ -G -z t ext -h libFresco.so.0.7 Sdisplay.o
Sdrawing.o Sfigures.o Sglyphs.o Slayouts.o St ypes.o Sviewers.o
Swidgets.o Xdisplay.o Xdrawing.o Xraster.o Xwindow.o figures.o
fresco.o glyphs.o inits.o layouts.o objects.o os.o ox-ids.o threads.o
transport .o types.o viewers.o widgets.o )

My site.def works fine without defining LdCmd.  In fact, some of the
stuff that you've defined you probably don't need to, like ArCmd and
CppCmd, since sun.cf takes care of them.

Also, you haven't shown us your full site.def, but the
CCompilerMajorVersion and the CplusplusCompilerMajorVersion definition
should go in the before vendor part of the site.def, otherwise sun.cf
will set up the multithreaded compile options to not use the -mt flag.

Here's a trimmed copy of my site.def that works just dandy:

#ifdef BeforeVendorCF

#undef  HasSunC
#define HasSunC YES
#undef  CCompilerMajorVersion
#define CCompilerMajorVersion 3
#undef  HasCplusplus
#define HasCplusplus YES
#undef  HasSunCplusplus
#define HasSunCplusplus YES
#undef  CplusplusCompilerMajorVersion
#define CplusplusCompilerMajorVersion 4
#undef  HasFortran
#define HasFortran YES

#endif /* BeforeVendorCF */

#ifdef AfterVendorCF

#define ProjectRoot /opt/x11r6

#undef  MakeCmd
#define MakeCmd /opt/suid/bin/make
#undef  CompressCmd
#define CompressCmd /usr/bin/compress
#undef  UNCOMPRESSPATH
#define UNCOMPRESSPATH /usr/bin/compress
#undef  LatexCmd
#define LatexCmd /opt/tex/bin/latex
#undef  DvipsCmd
#define DvipsCmd /opt/tex/bin/dvips

#define NeedConstPrototypes YES
#define NeedNestedPrototypes YES
#define NeedVarargsPrototypes YES
#define NeedFunctionPrototypes YES

#undef  OptimizedCDebugFlags
#define OptimizedCDebugFlags -O -xlibmil

#undef  OptimizedCplusplusDebugFlags
#define OptimizedCplusplusDebugFlags -O -xlibmil
#undef  PositionIndependentCplusplusFlags
#define PositionIndependentCplusplusFlags -PIC

#undef  FortranCmd
#define FortranCmd /opt/SUNWspro/bin/f77
#undef  FortranFlags
#define FortranFlags -O -xlibmil

#define HasLargeTmp YES

#define HasXdmAuth YES

#define BuildXKB YES

#define HasShadowPasswd YES

#endif /* AfterVendorCF */

Blair

---

From: [email-masked] (Casper H.S. Dik)
Date: 19 May 1994 21:20:03 GMT

>: __0oOXfFrescoObjectctv              0x18      	Sdisplay.o

This looks like a remaining reference that needs run-time resolving.
One cause could be: not specifying -K PIC when compiling.
I've also seen this occur with function (or was it data?) pointers assigned to
read-only data.

>transport .o types.o viewers.o widgets.o )

Well, I don't think that is right.  Calling ld instead of CC will
prevent static constructors from being called when the library is
loaded. But perhaps there aren't any.  (Fresco is meant to be
portable and shared libs and constructors are almost impossible
to achieve on some systems)

Casper

---

From: [email-masked] (Chris Flatters)
Date: 20 May 1994 00:52:05 GMT

>>>>> "Juergen" == Juergen Zimmermann <[email-masked]> writes:

    Juergen> I tried to compile X11R6 with SunPro C++ 4.0 under
    Juergen> Solaris 2.3 but failed wrt Fresco:

1 - You need to #define HasSunCplusplus YES.

2 - Definitions relating to the C/C++ compilers need to be in the
    BeforeVendorCF section of site.def.

	Chris Flatters
	[email-masked]