Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2007 15:15:22 GMT
From:      Scot Hetzel<swhetzel@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/112997: Add note about the 'native' mtune option to share/examples/etc/make.conf
Message-ID:  <200705251515.l4PFFM9Q028894@www.freebsd.org>
Resent-Message-ID: <200705251520.l4PFK2QK066060@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         112997
>Category:       conf
>Synopsis:       Add note about the 'native' mtune option to share/examples/etc/make.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 25 15:20:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Scot Hetzel
>Release:        7.0-CURRENT
>Organization:
>Environment:
FreeBSD hp010.hetzel.org 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Thu May 24 21:37:39 CDT 2007     root@hp010.hetzel.org:/usr/src/7x/sys-p4/amd64/compile/GENERIC.debug  amd64

>Description:
On the AMD64 mailing list there was a discussion on what to set CPUTYPE to for a users system.  During the discussion, the new 'native' mtune option for gcc 4.2 was brought up.  This option allows gcc to automatically tune the compile for the processor that the machine is being built on for the x86 and AMD64 architectures.

We need to warn users to not set CPUTYPE to 'native' in /etc/make.conf, as CPUTYPE is used to determine the value of MACHINE_CPU. But instead to use:

gcc -v -x c -E -mtune=native /dev/null -o /dev/null 2>&1 | grep mtune | sed -e 's/.*mtune=//'

to determine the value of CPUTYPE for their system.
>How-To-Repeat:

>Fix:
apply attached patch to share/examples/etc/make.conf

Patch attached with submission follows:

Index: make.conf
===================================================================
RCS file: /home/ncvs/src/share/examples/etc/make.conf,v
retrieving revision 1.279
diff -u -r1.279 make.conf
--- make.conf	17 Jan 2007 12:43:06 -0000	1.279
+++ make.conf	25 May 2007 15:08:52 -0000
@@ -40,6 +40,17 @@
 #   AMD64 architecture: opteron, athlon64, nocona, prescott, core2
 #   Intel ia64 architecture: itanium2, itanium
 #
+# On the Intel x86 and AMD architectures, you can use gcc to determine
+# determine the processor type of the compiling machine by using the
+# following command:
+#
+# gcc -v -x c -E -mtune=native /dev/null -o /dev/null 2>&1 | grep mtune | sed -e -e 's/.*mtune=//'
+#
+# set CPUTYPE to the value returned for mtune.
+#
+# NOTE: DO NOT set CPUTYPE to 'native' in make.conf, as CPUTYPE is used to
+#       set MACHINE_CPU in share/mk/bsd.cpu.mk.
+#
 # (?= allows to buildworld for a different CPUTYPE.)
 #
 #CPUTYPE?=pentium3


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705251515.l4PFFM9Q028894>