Re: cpu vs CPUTYPE
Jan Stary <[email protected]> Tue, 9 Jun 2026 11:49:52 +0200
| Newsgroups | gmane.os.freebsd.questions |
|---|---|
| Message-ID | <[email protected]> |
On Jun 07 09:29:50, [email protected] wrote: > I use these in my make.conf for an older xeon, > ARCH= amd64 > ARCHLEVEL= x86-64-v3 > CPUTYPE?= haswell > TARGET= amd64 > TARGET_ARCH= amd64 > TARGET_CPUTYPE= ${CPUTYPE} > I'm explicit with ARCH because I also cross build. I don't see any of these in either the example make.conf or the make.conf(5) manpage - but I don't cross compile, so that reduces it to: how did you come up with "haswell" being the right choice for your older Xeon? Is that documented somewhere? Looking at /usr/share/bsd.cpu.mk, I see that my naive choice of "core" (as in Intel Core) is an alias for "prescott", which on amd64 is an alias for "nocona" (listed in the example make.conf). Reading the buildkernel log, it seems that setting CPUTYPE ?= core traslates to -march=nocona in CFLAGS. I suppose this leaves it to the compiler to utilize the appropriate optimizations. I took a random line from the kernel build (the compilation of scsi_pass.o) and went through all the options, without any CPUTYPE and with CPUTYPE ?= core; indeed, the only difference is -march=nocona being added to the cc calls. The only mention on nocona in /usr/share/mk (besides the aliases above) is MACHINE_CPU = sse3; is that expected? Should I be seeing sse3 in the cc lines of buildkernel or is MACHINE_CPU only used internaly somehow? Anyway, back to my original question: when you set CPUTYPE ?= haswell for your Xeon (why?), what do you set as "cpu" in your KERCONF and why? And how are the two related? Also note that make.conf talks about GCC settings, referring to gcc.gnu.org for details; does that mean that it is supposed to be the same for clang, which is now the compiler (on amd64 at least)? Jan