From owner-cvs-ports@FreeBSD.ORG Thu Sep 8 04:00:41 2011 Return-Path: Delivered-To: cvs-ports@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 6CC751065672; Thu, 8 Sep 2011 04:00:41 +0000 (UTC) Date: Thu, 8 Sep 2011 04:00:41 +0000 From: Alexey Dokuchaev To: Pietro Cerutti Message-ID: <20110908040041.GA61427@FreeBSD.org> References: <201109071436.p87EaDGo097718@repoman.freebsd.org> <20110907155741.GA69663@FreeBSD.org> <20110907160643.GR98648@gahrfit.gahr.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20110907160643.GR98648@gahrfit.gahr.ch> User-Agent: Mutt/1.4.2.1i Cc: cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/audio/beast Makefile X-BeenThere: cvs-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2011 04:00:41 -0000 On Wed, Sep 07, 2011 at 06:06:44PM +0200, Pietro Cerutti wrote: > On 2011-Sep-07, 15:57, Alexey Dokuchaev wrote: > > On Wed, Sep 07, 2011 at 02:36:13PM +0000, Pietro Cerutti wrote: > > > gahr 2011-09-07 14:36:13 UTC > > > > > > Modified files: > > > audio/beast Makefile > > > Log: > > > - Unbreak > > > - Use sysctl to find out whether SSE is supported > > > > What's wrong with .if ${MACHINE_CPU:Msse} ? > > I found out that MACHINE_CPU does not reflect the actual caps of the CPU > the process is currently running on. This leads to false negative (no > sse in MACHINE_CPU on SSE-capable CPUs). Look at these outputs from a > test machine of mine: > > > make -V MACHINE_CPU > i486 This is correct for default CPUTYPE; it is done to ensure that default package will be runnable on the lowest supported chip, which in case of x86 is i486. Users who do not want to support ancient models (that is, they do not expect to run their binaries on them), are advised to set CPUTYPE in /etc/make.conf. > > sysctl hw.instruction_sse > hw.instruction_sse: 1 We should rely on what ports framework tells us about supported CPU features. Sticking our "dirty hands" in MD stuff is bad practice and would certainly become bogus e.g. when cross-compiling things. Even without cross compilation, it can result in code that would fail to run on desired CPUTYPE. > Unfortunately, using a sysctl here is the only reliable way I found to > determine SSE capabilities. Capabilities of the "build box". Which is not necessarily "run box". > Any suggestions how to do it better is warmly welcome! I believe the best thing is to revert this part of the change. Examining MACHINE_CPU is standard way of checking for specific CPU feature, used in many other ports. Your way is both inconsistent and just wrong: our build cluster machines definitely support SSE and friends, but generate packages for i486 -- for a reason. Your commit I believe would make such packages unsuable for anyone with pre-SSE CPU (including this port in question). ./danfe