Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Dec 2007 10:47:56 -0600
From:      "Scot Hetzel" <swhetzel@gmail.com>
To:        "Pete French" <petefrench@ticketswitch.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Is it safe to use CPUTYPE?=native on 7.0 ?
Message-ID:  <790a9fff0712160847m4c25cf31t756f0a7988e2e1f8@mail.gmail.com>
In-Reply-To: <E1J3w3B-000Iuy-Aw@dilbert.ticketswitch.com>
References:  <E1J3w3B-000Iuy-Aw@dilbert.ticketswitch.com>

next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_3857_17702457.1197823676294
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 12/16/07, Pete French <petefrench@ticketswitch.com> wrote:
> fairly simple question really - on machines where I never use the compiled
> binaries anywhere else, is it O.K. to set the CPU type to 'native' in
> make.conf ? According to gcc this should detect the processor type and
> set the various flas as approrpiate, which is nice, as we have a mix of P3,
> P4 and AMD processors around the place, and having one make.conf which will
> do the right thing on all of them would be nice.
>
> I've been trying it out on a couple of machines, and it seems to work fine,
> but I have a feeling that various bits of the kerenel complie are
> sensetive to the cpu type, so am just asking to check if it's O.K.
>
While setting CPUTYPE=native in /etc/make.conf may work, it fails to
set MACHINE_CPU to the correct values for your processor type.

The problem is that bsd.cpu.mk doesn't know how to handle CPU type 'native'.

There is a simple fix for this problem by applying the attached patch
which uses:

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

to reset CPUTYPE to the processor type of your system when CPUTYPE=native.

Scot

------=_Part_3857_17702457.1197823676294
Content-Type: text/x-diff; name=bsd.cpu.mk.patch
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fa9t80qp
Content-Disposition: attachment; filename=bsd.cpu.mk.patch

SW5kZXg6IGJzZC5jcHUubWsKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2hvbWUvbmN2cy9zcmMvc2hh
cmUvbWsvYnNkLmNwdS5tayx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS42MwpkaWZmIC11IC1yMS42
MyBic2QuY3B1Lm1rCi0tLSBic2QuY3B1Lm1rCTE2IE9jdCAyMDA3IDE4OjMyOjM3IC0wMDAwCTEu
NjMKKysrIGJzZC5jcHUubWsJMTcgT2N0IDIwMDcgMjI6Mjg6MzIgLTAwMDAKQEAgLTE4LDYgKzE4
LDE0IEBACiAuIGVuZGlmCiAuZWxzZQogCisjIEhhbmRsZSAnbmF0aXZlJyBieSBjb252ZXJ0aW5n
IGl0IHRvIHRoZSBhcHByb3ByaWF0ZSBDUFVUWVBFCisKKy5pZiAke01BQ0hJTkVfQVJDSH0gPT0g
ImkzODYiIHx8ICR7TUFDSElORV9BUkNIfSA9PSAiYW1kNjQiCisuIGlmICR7Q1BVVFlQRX0gPT0g
Im5hdGl2ZSIKK0NQVVRZUEUgIT0gZ2NjIC12IC14IGMgLUUgLW10dW5lPW5hdGl2ZSAvZGV2L251
bGwgLW8gL2Rldi9udWxsIDI+JjEgfCBncmVwIG10dW5lIHwgc2VkIC1lICdzLy4qbXR1bmU9Ly8n
CisuIGVuZGlmCisuZW5kaWYKKwogIyBIYW5kbGUgYWxpYXNlcyAobm90IGRvY3VtZW50ZWQgaW4g
bWFrZS5jb25mIHRvIGF2b2lkIHVzZXIgY29uZnVzaW9uCiAjIGJldHdlZW4gZS5nLiBpNTg2IGFu
ZCBwZW50aXVtKQogCg==
------=_Part_3857_17702457.1197823676294--



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