On Fri, 21 Dec 2001, Gregor N. Purdy wrote:

> Andy --
> 
> > Whilst building on Sparc/Solaris 8
> > 
> > $ perl -V:archname
> > archname='sun4-solaris-64int-ld';
> 
> This could cause some trouble. I was expecting cpuarch-osname
> (two dash-separated components only). I think we'll happily
> ignore the latter two entries, though. 

That's ok.  The extra fields are used for various non-default perl5
compilation options, such as threads, 64bit stuff, long doubles, etc.

> ignore the latter two entries, though. Do you consider "sun4"
> to be the cpuarch? Or is it really "sparc*"?

This is a harder question than you might have expected.  Consider the
following sequence of commands under Solaris 8:

$ uname -a
SunOS xxx 5.8 Generic_108528-12 sun4u sparc SUNW,Ultra-5_10
$ uname -m
sun4u
$ uname -p
sparc
$ arch
sun4
$ arch -k
sun4u

So what's the architecture?  Well, according to the uname(1) manpages,
     
     -m    Print the machine hardware name (class). Use  of  this
           option is discouraged; use uname -p instead. See NOTES
           section below.

NOTES:

     Independent software vendors (ISVs) and others who  need  to
     determine  detailed characteristics of the platform on which
     their software is either being installed or executed  should
     use the uname command.

     To determine the operating system name  and  release  level,
     use  uname  -sr.  To  determine  only  the  operating system
     release level, use uname -r.   Note  that  operating  system
     release  levels are not guaranteed to be in x.y format (such
     as 5.3, 5.4, 5.5, and so forth); future releases could be in
     the  x.y.z  format  (such  as  5.3.1,  5.3.2,  5.4.1, and so
     forth).

     In SunOS 4.x releases, the arch(1) command was often used to
     obtain  information  similar  to  that obtained by using the
     uname command. The arch(1) command output "sun4"  was  often
     incorrectly  interpreted to signify a SunOS SPARC system. If
     hardware platform information is desired, use uname -sp.

     The arch -k and uname -m commands return equivalent  values;
     however,  the use of either of these commands by third party
     programs is discouraged, as is the use of the  arch  command
     in  general.  To  determine  the  machine's  Instruction Set
     Architecture (ISA or processor type), use uname with the  -p
     option.

So Sun would like us to call this system a 'sparc'.  However, perl's
Configure is old enough to date from the Sun4 days, so it uses the
(now discouraged) arch command and perl -V:archname gives sun4.


Now, just to compilcate matters, what should Linux/sparc systems use?
Note that there are actually several different sparc kernels, depending 
on whether you're on an UltraSPARC or just a plain old ordinary SPARC.

Feeding the same set of commands to Linux uname, I get:

$ perl -V:archname
archname='sparc64-linux'
$ uname -a
Linux yyy 2.2.17 #1 Tue Jul 4 14:22:29 EDT 2000 sparc64 unknown
$ uname -p
unknown
$ uname -m
sparc64
$ arch
sparc64
$ arch -k
sparc64

(The 64 is supposed to indicate 64-bit capable, but it's actually
incorrect.  A flash PROM update is needed on earlier Ultra1 chips
(such as this one in that particular machine) for proper 64-bit
operation.  The Linux kernel does not test for this, as far as I
know.)

So what is the architecture?  I don't know.  I think you'd have to
accept sun4* and sparc* as valid architecture names.

I *know* that doesn't help much,

    Andy Dougherty              [EMAIL PROTECTED]
    Dept. of Physics
    Lafayette College, Easton PA 18042

Reply via email to