[Sunhelp] Re: SunHELP digest, Vol 1 #637 - 11 msgs

Greg gonufer at yahoo.com
Wed Oct 25 19:42:02 CDT 2000


> What would be another solution then?

Compile using the real compiler in the native Solaris 2.x environment.
/usr/ucb/cc is just a shell script, not a compiler.  It calls the real
compiler with extra options to compile your code in a Solaris 1.x
compatibility environment.  It's a migration aid for Solaris 1.x
applications so unless you're still in the transition process from
Solaris 1.x to 2.x you shouldn't use it.

> I've had to do this when compiling code and haven't seen any problems 
> yet (crossing my fingers...)

The most obvious problem is that the resulting program isn't "native" to
Solaris 2.x and only runs on machines with the optional source compatibility
packages installed.  Mixing and matching /usr/ucbinclude (via /usr/ucb/cc),
/usr/include, libc, and libucb also leads to subtle (and serious) problems
such as programs missing the first two characters of file/dir names when reading
directory entries (eg, readdir).

> I was made to understand that Solaris 2.8 came with the latest GNU 
> compiler (also downloadable from www.sunfreeware.com)

That's a much better choice than using the /usr/ucb/cc compiler wrapper.  Or
even adding the real location of the compiler (/opt/SUNWspro/ bin) to your
PATH instead of /usr/ucb.    If you're producing commercial applications I'd
hope you don't have the compatibility packages installed on your build
machines at all, it's only asking for problems down the line.  For example,
some of the Oracle 8i install programs were accidentally built by someone with
/usr/ucb in their PATH and unintentionally required that the optional
compatibility packages be installed just to install a product (due to the
bogus dependency on libucb) which didn't otherwise need those packages at
all.

-greg






More information about the SunHELP mailing list