From nobody Tue Jun 9 09:49:52 2026 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gZPK70PNrz6hhH8 for ; Tue, 09 Jun 2026 09:50:03 +0000 (UTC) (envelope-from hans@stare.cz) Received: from mx.stare.cz (uvt.stare.cz [185.63.96.79]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "prizen.cz", Issuer "prizen.cz" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gZPK50qDrz3NNJ for ; Tue, 09 Jun 2026 09:50:00 +0000 (UTC) (envelope-from hans@stare.cz) Authentication-Results: mx1.freebsd.org; dkim=fail ("headers rsa verify failed") header.d=stare.cz header.s=all header.b=SWCyyEfn; dkim=fail ("headers eddsa verify failed") header.d=stare.cz header.s=all header.b=DWF6r5Jw; dmarc=none; spf=pass (mx1.freebsd.org: domain of hans@stare.cz designates 185.63.96.79 as permitted sender) smtp.mailfrom=hans@stare.cz DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=all; bh=0i3U7IqEeYUs 6wqAqnBl8BpeYHYgkRl0N009aTB//u4=; h=in-reply-to:references:subject:to: from:date; d=stare.cz; b=SWCyyEfnNaF0P2ZLgUI1dNf5uiXvmv1pobdrFF04+ALzI p0ObXOUJuVzKgCIQ96bRXtTwT87hx7vB90PpV5OBQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=all; bh=0i3U7IqEeYUs6wqA qnBl8BpeYHYgkRl0N009aTB//u4=; h=in-reply-to:references:subject:to: from:date; d=stare.cz; b=DWF6r5JwQpaBZW2aIyfRlibTbxpaGcvpnWJUGYPHIUzJO KbgzTOYtbUCVm5WDV+JhdViyuMdCAJg45cn/JUf/v4y3jBkXbxx5Tz1mDZ2rkieNGO/tdJ ELTpq1PxWbBGg6GhSw450eoOGeS4NjsT8ipzH+3IWvmVHiT4tq68lL9LAfeE41iJZpKDTx rAs7cjmk08WpFXkURFPv1YrPMiVKrholgNnt3Y4ppSFqryFWE2+wJ9TSwyN9DUPfxrtRsW X8UysY3x3eXTSberpnRI5RiDfpe17JPBh5KL9jFt+ujKe36eC127khk9GVaXlGAdGkLhGO mJAsi+5wQyxralpyA== Received: from localhost (stare.cz [local]) by stare.cz (OpenSMTPD) with ESMTPA id 2f006900 for ; Tue, 9 Jun 2026 11:49:52 +0200 (CEST) Date: Tue, 9 Jun 2026 11:49:52 +0200 From: Jan Stary To: questions@freebsd.org Subject: Re: cpu vs CPUTYPE Message-ID: References: List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [0.54 / 15.00]; R_DKIM_REJECT(1.00)[stare.cz:s=all]; NEURAL_SPAM_MEDIUM(1.00)[0.998]; NEURAL_HAM_SHORT(-0.99)[-0.988]; NEURAL_HAM_LONG(-0.87)[-0.869]; MID_RHS_WWW(0.50)[]; ONCE_RECEIVED(0.20)[]; R_SPF_ALLOW(-0.20)[+ip4:185.63.96.79]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[stare.cz:-]; DMARC_NA(0.00)[stare.cz]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RECEIVED_HELO_LOCALHOST(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MISSING_XM_UA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; ASN(0.00)[asn:50825, ipnet:185.63.96.0/22, country:CZ]; FROM_HAS_DN(0.00)[] X-Spamd-Bar: / X-Rspamd-Queue-Id: 4gZPK50qDrz3NNJ On Jun 07 09:29:50, dewayne@heuristicsystems.com.au 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