Setting CPUTYPE=native, fails to set MACHINE_CPU correctly.

From: Scot Hetzel <swhetzel_at_gmail.com>
Date: Tue, 28 Aug 2007 01:54:58 -0500
Gcc 4.2 has a new cpu_type (native) for x86 and amd64 systems.  This
cpu_type is to allow gcc to automatically detect the processor type
that gcc is running on.

The problem is that setting CPUTYPE?=native in either src.conf or
make.conf will cause MACHINE_CPU to be set to the wrong value for the
native cpu.

For example on a system where the processor is a k8, setting CPUTYPE
to k8, shows that MACHINE_CPU is set as follows:

hp010# make -V MACHINE_CPU -DCPUTYPE=k8
k8 3dnow amd64 sse2 sse mmx

But setting CPUTYPE to native on a k8 system sets MACHINE_CPU to this value:

hp010# make -V MACHINE_CPU -DCPUTYPE=native
unknown amd64 sse2 sse mmx

After patching share/mk/bsd.cpu.mk (see attachment) or the last patch
to PR 112997:

  http://www.freebsd.org/cgi/query-pr.cgi?pr=112997

setting CPUTYPE to native now works correctly when setting the value
for MACHINE_CPU:

hp010# make -V MACHINE_CPU -V CPUTYPE -DCPUTYPE=native
k8 3dnow amd64 sse2 sse mmx
k8

Could this get committed before -CURRENT is branched.

Thanks,

Scot

-- 
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.

Received on Tue Aug 28 2007 - 04:55:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:16 UTC