kern/77355: Detect i*86 subarches for uname

Bruce Evans bde at
Fri Feb 11 06:10:30 PST 2005

The following reply was made to PR kern/77355; it has been noted by GNATS.

From: Bruce Evans <bde at>
To: "Devon H. O'Dell" <dodell at>
Cc: Robert Millan <rmh at>, freebsd-gnats-submit at
Subject: Re: kern/77355: Detect i*86 subarches for uname
Date: Sat, 12 Feb 2005 01:05:50 +1100 (EST)

 [gnats restored in Cc:]
 On Fri, 11 Feb 2005, Devon H. O'Dell wrote:
 > On Fri, 2005-02-11 at 13:25 +0100, Robert Millan wrote:
 > > On Fri, Feb 11, 2005 at 11:18:25AM +0100, Devon H. O'Dell wrote:
 > > > >
 > > > >  With this change, the config.guess triplet becomes i686-unknown-freebsd5.3
 > > > >  (or whatever suitable).  Some programs detect this and use it for optimisation.
 > > >
 > > > The proper way to specify optimizations in FreeBSD is with relevant
 > > > entries in /etc/make.conf.
 > >
 > > But this only affects the port system when passing --host and --build to
 > > configure scripts, right?
 > >
 > > I'm more concerned about programs that run config.guess on their own.
 > Actually, make.conf is used to modify various flags used in the files
 > in /usr/share/mk and /usr/ports/Mk. Nothing would be passed to --host
 > and --build; the Makefile would use the desired CFLAGS when building,
 > which might include -march=whatever.
 > Since FreeBSD encourages the use of its ports collection (and other
 > package systems such as pkgsrc use similar tricks to do this), I really
 > don't see this as an issue. Perhaps the only thing I see this useful for
 > is if you don't particularly care to use any package system, which isn't
 > really good for the project since we don't get to benefit from the
 > software you're using. It's farily simple to wrap any software into a
 > port file, regardless of what utilities you are using.
 It is needed for correctness.  From "man uname | col -bx":
      -m      Write the type of the current hardware platform to standard out-
      -p      Write the type of the machine processor architecture to standard
 -p is supposed to give the arch (e.g., -i386) and -m is supposed to
 give the platfrom (is that the sub-arch?) (e.g., i686).  It is useless
 for these to return the same string.  (i686 is also useless, since it
 is the same for all i386's newer than about 8 years old, but that is
 another bug.  The hw.model sysctl gives more useful info (e.g.,
 "AMD Athlon(tm)"), but uname(1) only uses uname(2) which doesn't go
 near this sysctl.)
 However, I don't like changing the -a output (-a gets -m but not -p).

More information about the freebsd-bugs mailing list