From rmh@khazad.dyndns.org  Thu Feb 10 18:04:12 2005
Return-Path: <rmh@khazad.dyndns.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4D84B16A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 10 Feb 2005 18:04:12 +0000 (GMT)
Received: from khazad.dyndns.org (137.red-62-57-138.user.auna.net [62.57.138.137])
	by mx1.FreeBSD.org (Postfix) with ESMTP id F0DBA43D2F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 10 Feb 2005 18:04:11 +0000 (GMT)
	(envelope-from rmh@khazad.dyndns.org)
Received: from rmh by khazad.dyndns.org with local (Exim 4.34)
	id 1CzIG8-0005kp-E5
	for FreeBSD-gnats-submit@freebsd.org; Thu, 10 Feb 2005 18:37:44 +0100
Message-Id: <E1CzIG8-0005kp-E5@khazad.dyndns.org>
Date: Thu, 10 Feb 2005 18:37:44 +0100
From: Robert Millan <rmh@debian.org>
Reply-To: Robert Millan <rmh@debian.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Detect i*86 subarches for uname
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         77355
>Category:       i386
>Synopsis:       [patch] Detect i*86 subarches for uname
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 10 18:10:22 GMT 2005
>Closed-Date:    Mon Oct 24 14:33:17 UTC 2011
>Last-Modified:  Mon Oct 24 14:33:17 UTC 2011
>Originator:     Robert Millan
>Release:        GNU/kFreeBSD 5.3-3 i686
>Organization:
Debian
>Environment:
System: GNU/kFreeBSD aragorn 5.3-3 #0: Thu Feb 10 15:39:57 CET 2005 i686 GNU/KFreeBSD


	
>Description:
This patch enables the kernel of FreeBSD to give output of i*86 subarches
in the uname kernel call.  As a result, `uname -m' may print "i686", etc
instead of always "i386".

	
>How-To-Repeat:
	
>Fix:

--- src/sys/i386/i386/identcpu.c.old	2005-02-08 05:02:33.000000000 +0100
+++ src/sys/i386/i386/identcpu.c	2005-02-08 05:05:09.000000000 +0100
@@ -604,6 +604,7 @@
 #if defined(I486_CPU)
 	case CPUCLASS_486:
 		printf("486");
+		machine[1] = '4';
 		bzero_vector = i486_bzero;
 		break;
 #endif
@@ -614,6 +615,7 @@
 		       (intmax_t)(tsc_freq + 4999) / 1000000,
 		       (u_int)((tsc_freq + 4999) / 10000) % 100);
 		printf("586");
+		machine[1] = '5';
 		break;
 #endif
 #if defined(I686_CPU)
@@ -623,6 +625,7 @@
 		       (intmax_t)(tsc_freq + 4999) / 1000000,
 		       (u_int)((tsc_freq + 4999) / 10000) % 100);
 		printf("686");
+		machine[1] = '6';
 		break;
 #endif
 	default:
>Release-Note:
>Audit-Trail:

From: Kris Kennaway <kris@obsecurity.org>
To: Robert Millan <rmh@debian.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/77355: Detect i*86 subarches for uname
Date: Thu, 10 Feb 2005 15:08:26 -0800

 Why?  Sounds like it could break a lot of stuff.
 
 Kris

From: Robert Millan <rmh@debian.org>
To: Kris Kennaway <kris@obsecurity.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/77355: Detect i*86 subarches for uname
Date: Fri, 11 Feb 2005 09:30:35 +0100

 On Thu, Feb 10, 2005 at 03:08:26PM -0800, Kris Kennaway wrote:
 > > >Description:
 > > This patch enables the kernel of FreeBSD to give output of i*86 subarches
 > > in the uname kernel call.  As a result, `uname -m' may print "i686", etc
 > > instead of always "i386".
 > 
 > Why?  Sounds like it could break a lot of stuff.
 
 With this change, the config.guess triplet becomes i686-unknown-freebsd5.3
 (or whatever suitable).  Some programs detect this and use it for optimisation.
 
 -- 
  .''`.   Proudly running Debian GNU/kFreeBSD unstable/unreleased (on UFS2+S)
 : :' :
 `. `'    http://www.debian.org/ports/kfreebsd-gnu
   `-

From: Bruce Evans <bde@zeta.org.au>
To: "Devon H. O'Dell" <dodell@sitetronics.com>
Cc: Robert Millan <rmh@debian.org>, freebsd-gnats-submit@freebsd.org
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-
              put.
      ...
      -p      Write the type of the machine processor architecture to standard
              output.
 %%%
 
 -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).
 
 Bruce

From: Robert Millan <rmh@aybabtu.com>
To: bug-followup@FreeBSD.org
Cc: Bruce Evans <bde@zeta.org.au>
Subject: Re: kern/77355: Detect i*86 subarches for uname
Date: Sat, 18 Feb 2006 14:02:31 +0100

 Hi!
 
 Can we revisit this?  It's feasible for us to have this in HW_MACHINE_ARCH
 instead (-p).
 
 Would you like me to send a patch for that?
 
 Bruce Evans <bde@zeta.org.au> wrote:
 > -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).
 
 -- 
 Robert Millan

From: Alexander Best <alexbestms@wwu.de>
To: <bug-followup@FreeBSD.org>
Cc: Robert Millan <rmh@debian.org>,
 Bruce Evans <bde@zeta.org.au>
Subject: Re: kern/77355: [i386] [patch] Detect i*86 subarches for uname
Date: Tue, 09 Feb 2010 17:57:38 +0100 (CET)

 how about returning "hw.model" for uname -p? i believe this is what linux is
 doing. also since the -p option isn't defined in POSIX.1-2008, (cross
 platform) scripts etc. shouldn't depend on it.
 
 also i don't see a reason why uname -m shouldn't return i686. this is the
 architecture of all modern ia32 cpus. and as mentioned before this would
 trigger i686 specific optimisation in certain scripts. although most scripts
 use /etc/make.conf or gcc itself for detecting cpu specific features.
 
 cheers.
 alex
 
 ps: the pr which requested the -p option back in 1998 is bin/5826.

From: Alexander Best <alexbestms@wwu.de>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: kern/77355: [i386] [patch] Detect i*86 subarches for uname
Date: Mon, 26 Apr 2010 22:50:40 +0200 (CEST)

 please suspend this pr. although the requested changes are trivial they're not
 going to happen, because different opinions concerning this topic within the
 freebsd developer community exist.
 
 -- 
 Alexander Best
State-Changed-From-To: open->suspended 
State-Changed-By: linimon 
State-Changed-When: Mon Apr 26 23:21:37 UTC 2010 
State-Changed-Why:  
Mark suspended.  Apparently there is no consensus on this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77355 
Responsible-Changed-From-To: freebsd-bugs->freebsd-i386 
Responsible-Changed-By: arundel 
Responsible-Changed-When: Sat Aug 6 12:12:09 UTC 2011 
Responsible-Changed-Why:  
i386 related PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77355 
State-Changed-From-To: suspended->closed 
State-Changed-By: remko 
State-Changed-When: Mon Oct 24 14:33:15 UTC 2011 
State-Changed-Why:  
More then a year after the last change, there is still no consensus nor 
had there been any progress. I dont want to keep this open without 
additional progress.. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77355 
>Unformatted:
