cvs commit: ports/audio/beast Makefile

Alexey Dokuchaev danfe at FreeBSD.org
Thu Sep 8 04:00:41 UTC 2011


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


More information about the cvs-all mailing list