From nobody@FreeBSD.org  Thu Jun  9 14:57:59 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3445916A41C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  9 Jun 2005 14:57:59 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 16EE643D1D
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  9 Jun 2005 14:57:59 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j59Evwe5039317
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 9 Jun 2005 14:57:58 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j59EvwNF039316;
	Thu, 9 Jun 2005 14:57:58 GMT
	(envelope-from nobody)
Message-Id: <200506091457.j59EvwNF039316@www.freebsd.org>
Date: Thu, 9 Jun 2005 14:57:58 GMT
From: Shusnuke SHINOMIYA <shino@fornext.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: incorrect -march's parameter to build 32bit libraries 
X-Send-Pr-Version: www-2.3

>Number:         82071
>Category:       amd64
>Synopsis:       incorrect -march's parameter to build 32bit libraries
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-amd64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 09 15:00:32 GMT 2005
>Closed-Date:    Thu Jul 06 12:21:04 GMT 2006
>Last-Modified:  Thu Jul 06 12:21:04 GMT 2006
>Originator:     Shusnuke SHINOMIYA
>Release:        FreeBSD/amd64 5.4-STABLE
>Organization:
>Environment:
FreeBSD walnut.net.ss.titech.ac.jp 5.4-STABLE FreeBSD 5.4-STABLE #0: Sat May  7 15:57:39 JST 2005     shino@walnut.net.ss.titech.ac.jp:/usr/obj/usr/src/sys/WALNUT  amd64

>Description:
In src/Makefile.inc1, -march's parameter is hard-coded as athlon-xp in order to build 32bit libraries.
But, I think appropriate -march in Intel Xeon environment is prescott.

BTW, nocona is not AMD CPU. However nocona is listed as `AMD CPUs' in share/examples/etc/make.conf.

>How-To-Repeat:

>Fix:
--- Makefile.inc1.orig  Thu Jun  9 23:30:41 2005
+++ Makefile.inc1       Thu Jun  9 23:35:26 2005
@@ -205,7 +205,13 @@
 # 32 bit world
 LIB32TMP=      ${OBJTREE}${.CURDIR}/lib32

-LIB32PREFLAGS= -m32 -march=athlon-xp -msse2 -mfancy-math-387 -DCOMPAT_32BIT
+LIB32PREFLAGS= -m32 -msse2 -mfancy-math-387 -DCOMPAT_32BIT
+.if ${TARGET_CPUTYPE} == "nocona"
+LIB32PREFLAGS+=        -march=prescott
+.else
+LIB32PREFLAGS+=        -march=athlon-xp
+.endif
+
 LIB32POSTFLAGS=        -I${LIB32TMP}/usr/include \
                -L${LIB32TMP}/usr/lib32 \
                -B${LIB32TMP}/usr/lib32

>Release-Note:
>Audit-Trail:

From: Kris Kennaway <kris@obsecurity.org>
To: Shusnuke SHINOMIYA <shino@fornext.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: amd64/82071: incorrect -march's parameter to build 32bit libraries
Date: Thu, 9 Jun 2005 13:27:27 -0400

 --AhhlLboLdkugWU4S
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Thu, Jun 09, 2005 at 02:57:58PM +0000, Shusnuke SHINOMIYA wrote:
 >=20
 > >Number:         82071
 > >Category:       amd64
 > >Synopsis:       incorrect -march's parameter to build 32bit libraries
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       high
 > >Responsible:    freebsd-amd64
 > >State:          closed
 > >Quarter:       =20
 > >Keywords:      =20
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Thu Jun 09 15:00:32 GMT 2005
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Shusnuke SHINOMIYA
 > >Release:        FreeBSD/amd64 5.4-STABLE
 > >Organization:
 > >Environment:
 > FreeBSD walnut.net.ss.titech.ac.jp 5.4-STABLE FreeBSD 5.4-STABLE #0: Sat =
 May  7 15:57:39 JST 2005     shino@walnut.net.ss.titech.ac.jp:/usr/obj/usr/=
 src/sys/WALNUT  amd64
 >=20
 > >Description:
 > In src/Makefile.inc1, -march's parameter is hard-coded as athlon-xp in or=
 der to build 32bit libraries.
 > But, I think appropriate -march in Intel Xeon environment is prescott.
 >=20
 
 > BTW, nocona is not AMD CPU. However nocona is listed as `AMD CPUs' in sha=
 re/examples/etc/make.conf.
 
 Wasn't that already fixed?
 
 > >How-To-Repeat:
 >=20
 > >Fix:
 > --- Makefile.inc1.orig  Thu Jun  9 23:30:41 2005
 > +++ Makefile.inc1       Thu Jun  9 23:35:26 2005
 > @@ -205,7 +205,13 @@
 >  # 32 bit world
 >  LIB32TMP=3D      ${OBJTREE}${.CURDIR}/lib32
 >=20
 > -LIB32PREFLAGS=3D -m32 -march=3Dathlon-xp -msse2 -mfancy-math-387 -DCOMPA=
 T_32BIT
 > +LIB32PREFLAGS=3D -m32 -msse2 -mfancy-math-387 -DCOMPAT_32BIT
 > +.if ${TARGET_CPUTYPE} =3D=3D "nocona"
 > +LIB32PREFLAGS+=3D        -march=3Dprescott
 > +.else
 > +LIB32PREFLAGS+=3D        -march=3Dathlon-xp
 > +.endif
 
 This should probably go into bsd.cpu.mk somehow to avoid scattering
 -march logic elsewhere in the system.
 
 Kris
 
 --AhhlLboLdkugWU4S
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.1 (FreeBSD)
 
 iD8DBQFCqHv+Wry0BWjoQKURAibMAKDE6jzQuDdeCfsppA/5Hr7f33nYZgCg3IxX
 AHBWQrCtFEbInX6QDx1jwnA=
 =XqZi
 -----END PGP SIGNATURE-----
 
 --AhhlLboLdkugWU4S--
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Thu Jul 6 12:20:25 UTC 2006 
State-Changed-Why:  
This was fixed by obrien in December '05 (r1.529 of Makefile.inc1) 

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