From owner-freebsd-hackers@freebsd.org Fri Oct 4 17:17:04 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9CAC133B19 for ; Fri, 4 Oct 2019 17:17:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lGl45vStz4b59; Fri, 4 Oct 2019 17:17:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 670EB1CB5; Fri, 4 Oct 2019 17:17:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::1580:4763:8263:d913] (unknown [IPv6:2001:470:7a58:0:1580:4763:8263:d913]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 74CE04BF71; Fri, 4 Oct 2019 19:17:02 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_334A27A3-D319-42A6-AFC6-7DC1E277F703"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: CPUTYPE?= in make.conf Date: Fri, 4 Oct 2019 19:16:53 +0200 In-Reply-To: <20191004141338.GA72749@bastion.zyxst.net> Cc: freebsd-hackers@freebsd.org To: tech-lists References: <20191004141338.GA72749@bastion.zyxst.net> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2019 17:17:05 -0000 --Apple-Mail=_334A27A3-D319-42A6-AFC6-7DC1E277F703 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 4 Oct 2019, at 16:13, tech-lists wrote: >=20 > I hope this is the right place to ask about this; if not please = suggest where? >=20 > I have a large poudriere system running 12.1-STABLE #0 r352869. It = compiles > ports in poudriere jails for many other smaller systems, some on same = arch > (amd64) but different cpu types. >=20 > The host cputype is: >=20 > # llvm-tblgen --version > LLVM (http://llvm.org/): > LLVM version 8.0.1 > Optimized build. > Default target: x86_64-unknown-freebsd12.1 > Host CPU: sandybridge >=20 > The actual cpu is Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz (x2) >=20 > If I make a make.conf for a poudriere jail and define CPUTYPE?=3Dbtver1,= several > ports fail to compile, like python36 and lzo2. >=20 > If I do the same and define it as CPUTYPE?=3Dhaswell, *everything* = fails apart > from building the jail itself. This will never work. Your host Sandybridge CPU is of an earlier generation (2nd) than the target, which is Haswell. Targeting Haswell, the compiler will generate instructions that the host CPU does not support, which in turn will lead to SIGILL signals as soon as such instructions are encountered. Similarly, btver1 is an AMD CPU (family 14h), which is likely to differ from your host CPU in which instructions it supports. I guess you were just lucky that any programs ran at all... :) > If I do the same thing on a different host, where the host cpu is: = Intel(R) > Core(TM) i7-4770K CPU @ 3.50GHz >=20 > no failures happen. llvm-tblgen here reports haswell. The freebsd = version is > the same. Yes, i7-4770K is of the Haswell generation, so that is expected to work. > What I'm asking is, is this a hardware failure on the failing system? = Or is it > a capabilities issue, in that the one having the problem hasn't got = the right > instruction set? This is not a hardware failure, but totally expected behavior. You can only run poudriere builds for CPUs of an equal, or earlier generation, and even then you will have to ensure that the target CPU does not accidentally support instructions from your host CPU. > I'm hoping for a performance boost if ports are compiled to the = specific > cputype of the target machine. It will depend greatly on the type of program. Some can see minor or even large performance gains, for example if it is possible to vectorize many loops in the program. But for many programs, you will likely find little to no differences. -Dimitry --Apple-Mail=_334A27A3-D319-42A6-AFC6-7DC1E277F703 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXZd+hQAKCRCwXqMKLiCW o5osAKCncxoQPmvOiTlEk/ugoUqL2/cnJgCfXw6S/sg8V45JTlCu02fThV/qK4g= =vimx -----END PGP SIGNATURE----- --Apple-Mail=_334A27A3-D319-42A6-AFC6-7DC1E277F703--