SUMMARY: apps and libraries built with Forte AND gcc (mixed)

From: Ian Veach <imail_at_nevada.edu>
Date: Fri Jun 06 2003 - 12:18:39 EDT
Thanks to: Casper Dik, Roy S. Rapoport, Lars Hecking, Dennis, David M.,
David Foster, Octave Orgeron

======================================================================
a) Can I mix code [C or C++] and libraries compiled with different
	compilers (e.g. Forte cc and GCC)?
======================================================================

	Yes and no.  :)  Everyone said yes you could with C (although
"linking gcc compiled object files may require linking with the gcc
runtime (i.e., may require linking using gcc)").  Also note that there are
definate exceptions to this rule - a longstanding one is perl (all
modules and perl, excepting obvious system binaries pre-compiled with
Forte), which by many accounts MUST be compiled with the same compiler.

It was confirmed that C++ is a firm no, however:

"C++ is a whole different matter; no, it is not possible (not
even between versions of GNU C++, Forte tends to support
compatibility for some time) No C++ ABI has been defined.  You
may get away mixing modules compiled with different C++ compiler
as long as the different compilers are self-contained; symbol
clashes may cause linking failures, though"

Also:

"It shouldnt make any difference unless high-end performance is an issue.
we run a mix of stuff compiled here with gcc (2.9.5, 3.X) and with forte
(6.2)."

Anyway, forte would be preferable, but in a pinch the stuff from
www.sunfreeware.com
is compiled using forte so thats another option.


======================================================================
b) Can I mix 64 bit and 32 bit code and libraries?
======================================================================

	No.  The man pages for ld indicate this, actually.  Apparently the
linker "determines the "bitness" of an exectable from the first object
it encounters and bombs on the first mismatch."  LIBPATH is set to EITHER
/usr/lib or /usr/lib/64 accordingly.


======================================================================
c) Does anyone have evidence (performance, etc.) of why using cc (Forte
	5 or 6) to compile something would be better than gcc
======================================================================

	Answers wholly in the yes category.  "I think there's plenty of
evidence, especially when it comes to FP code."

	"gcc is not optimized for 64-bit code"


======================================================================
d) Does anyone have good pointers to a document on these concepts and how
	they apply to Solaris?  I haven't found much google.
======================================================================

	no answers

======================================================================
Other info:
======================================================================

* "Forte ...definitely does *compile* faster"

* "The latest Forte compilers support more GNUisms and also C++ comments
(and more of C99 constructs)."

* "Building "non-standard code" with Forte can be a problem sometimes with
non-portable code (or non-Solaris Forte code :) ).  These compiler options
can be useful:

-w              Suppress compiler warning messages
-Xa             Compile assuming ANSI C conformance, allow K & R
extensions (default mode)
-Xc             Compile assuming strict ANSI C conformance
-Xs             Compile assuming (pre-ANSI) K & R C style code
-Xt             Compile assuming K & R conformance, allow ANSI C"

======================================================================



On Wed, 4 Jun 2003, Ian Veach wrote:

> I have a few newbie questions on compiling, and hope someone might shed
> some light (on any or all) if you can:
>
> a) Can I mix code [C or C++] and libraries compiled with different
> 	compilers (e.g. Forte cc and GCC)?
> b) Can I mix 64 bit and 32 bit code and libraries?
> c) Does anyone have evidence (performance, etc.) of why using cc (Forte
> 	5 or 6) to compile something would be better than gcc
> d) Does anyone have good pointers to a document on these concepts and how
> 	they apply to Solaris?  I haven't found much google.
>
> Reasons: We're running Solaris 8 and planning on building Apache + PHP +
> PHP support (jpeg, png, imap, ssl, zlib, mcrypt, mhash, etc...).  We'd
> prefer to use Forte for everything, but in the past we've had problems
> with getting certain things to compile with it at all with it; In those
> cases, we've given up and just compiled them with gcc.  However, we're
> concerned with mixing and matching libraries and code compiled with mixed
> compilers [not the unresolved symbols compile-fail, but the non-evident
> creeping problems that might happen with apps running in production].
> We're also concerned with certain things that might only compile 32 bit
> but call (or be called by) an external library.
>
> Thanks for any light you can shed.  Sorry this is more compiler theory
> than Sun-specific, but I figure there might be different answers for
> different native compilers.
>
> Ian
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Jun 6 12:21:33 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:12 EST