From nobody@FreeBSD.org  Thu Apr 10 12:44:51 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FEC5106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Apr 2008 12:44:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 808378FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Apr 2008 12:44:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m3ACiVmW047155
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Apr 2008 12:44:31 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m3ACiVdp047154;
	Thu, 10 Apr 2008 12:44:31 GMT
	(envelope-from nobody)
Message-Id: <200804101244.m3ACiVdp047154@www.freebsd.org>
Date: Thu, 10 Apr 2008 12:44:31 GMT
From: Robert Woolley <freebsd-pr08@mlists.homeunix.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsd.cpu.mk doesn't handle opteron/athlon64/k8 properly for i386
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         122623
>Category:       i386
>Synopsis:       [build] [patch] bsd.cpu.mk doesn't handle opteron/athlon64/k8 properly for i386
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 10 12:50:02 UTC 2008
>Closed-Date:    Wed Mar 23 07:25:26 UTC 2011
>Last-Modified:  Wed Mar 23 07:25:26 UTC 2011
>Originator:     Robert Woolley
>Release:        7.0
>Organization:
>Environment:
FreeBSD gumby.homeunix.com 7.0-RELEASE FreeBSD 7.0-RELEASE #11: Sat Mar 29 03:29:48 GMT 2008     root@gumby.homeunix.com:/usr/obj/usr/src/sys/MUSTARD  i386

>Description:
In bsd.cpu.mk the cputypes opteron/athlon64/k8 are treated as aliases for athlon-mp on i386, despite the fact that there is separate handling for these processors'  MACHINE_CPU further down the file, and the types are understood by gcc.

Also k8 is  ommitted where MACHINE_CPU is set for  opteron/athlon64.

>How-To-Repeat:
If you set CPUTYPE=athlon64, athlon-mp is used in the -march option, and  MACHINE_CPU doesn't have sse2.
>Fix:
Patch removes aliases for opteron/athlon64/k8, and adds k8 in the MACHINE_CPU section.

Patch attached with submission follows:

--- ./share/mk/bsd.cpu.mk.orig	2007-10-19 18:08:38.000000000 +0100
+++ ./share/mk/bsd.cpu.mk	2008-03-22 18:30:02.000000000 +0000
@@ -44,9 +44,6 @@
 CPUTYPE = pentium-mmx
 .  elif ${CPUTYPE} == "i586"
 CPUTYPE = pentium
-.  elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \
-     ${CPUTYPE} == "k8"
-CPUTYPE = athlon-mp
 .  elif ${CPUTYPE} == "k7"
 CPUTYPE = athlon
 .  endif
@@ -116,7 +113,7 @@
 # presence of a CPU feature.
 
 . if ${MACHINE_ARCH} == "i386"
-.  if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64"
+.  if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
 MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
 .  elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \
     ${CPUTYPE} == "athlon-4"


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: remko 
State-Changed-When: Wed Mar 23 07:23:49 UTC 2011 
State-Changed-Why:  
Hello, 

Is this still relevant? (the code had not been changed as far 
as I can see). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122623 
State-Changed-From-To: feedback->closed 
State-Changed-By: remko 
State-Changed-When: Wed Mar 23 07:25:25 UTC 2011 
State-Changed-Why:  
Seems that the submitters address bounces. If someone can confirm 
whether or not this is still relevant, please get back to me. 

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