From owner-freebsd-stable@FreeBSD.ORG Sun Dec 16 16:47:58 2007 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170F316A419 for ; Sun, 16 Dec 2007 16:47:58 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 90BD113C474 for ; Sun, 16 Dec 2007 16:47:57 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so217905fgg.35 for ; Sun, 16 Dec 2007 08:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=qOjW4nyjl7kYuCr/Sii3099xh+Hp3pS97W+vj53VUUg=; b=CSjx1iLGCU9oi2+73mxbi6RZ3WYifB+lhsoHSOsxOCiDefjU3CeUXgh2aQHSo4eVllqK6I67Xvc0cMiRdN0ARzyUZ1DYue3aZ9JYNEjsH9FXAPslOhUljuEp1WP9zgP+KT6z8mDLqFGfVzjlDH7W/cIhymu9FgAsubz0qqIT8Kg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=KhtNBcY0xpJ1A2sgHVZSG0lflRn8BG2xUkzvOg7H+13MR1jX+oPZBa8Xc5i4W3HsQoXtYGvVkB5zJNyNQsMu0LyKzFlbivmAzKgCYAuCZMris6okSmQKPrm51IvoyAqmumoGF04XgJxGz8rSGaoworeAhabDb//PKSHZncQ+cgI= Received: by 10.86.1.1 with SMTP id 1mr5479091fga.2.1197823676307; Sun, 16 Dec 2007 08:47:56 -0800 (PST) Received: by 10.86.3.20 with HTTP; Sun, 16 Dec 2007 08:47:56 -0800 (PST) Message-ID: <790a9fff0712160847m4c25cf31t756f0a7988e2e1f8@mail.gmail.com> Date: Sun, 16 Dec 2007 10:47:56 -0600 From: "Scot Hetzel" To: "Pete French" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3857_17702457.1197823676294" References: Cc: freebsd-stable@freebsd.org Subject: Re: Is it safe to use CPUTYPE?=native on 7.0 ? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2007 16:47:58 -0000 ------=_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 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--