Bug 82071

Summary: incorrect -march's parameter to build 32bit libraries
Product: Base System Reporter: Shusuke SHINOMIYA <shino>
Component: amd64Assignee: freebsd-amd64 (Nobody) <amd64>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.4-STABLE   
Hardware: Any   
OS: Any   

Description Shusuke SHINOMIYA 2005-06-09 16:00:32 UTC
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.

Fix: 

-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--1Aiaelq7qbZ3t0ToQunASNm4og4nQsmzoCiTliBcxJQFs3Lx
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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
Comment 1 Kris Kennaway 2005-06-09 18:27:27 UTC
On Thu, Jun 09, 2005 at 02:57:58PM +0000, Shusnuke SHINOMIYA wrote:
> 
> >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:
> >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
> 
> >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.


Wasn't that already fixed?

> >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


This should probably go into bsd.cpu.mk somehow to avoid scattering
-march logic elsewhere in the system.

Kris
Comment 2 Tilman Keskinoz freebsd_committer freebsd_triage 2006-07-06 13:20:25 UTC
State Changed
From-To: open->closed

This was fixed by obrien in December '05 (r1.529 of Makefile.inc1)