Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2016 19:39:09 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 206620] audio/lame: fix build with clang 3.8.0 (and gcc >= 4.9.0)
Message-ID:  <bug-206620-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206620

            Bug ID: 206620
           Summary: audio/lame: fix build with clang 3.8.0 (and gcc >=3D
                    4.9.0)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: netchild@FreeBSD.org
          Reporter: dim@FreeBSD.org
          Assignee: netchild@FreeBSD.org
             Flags: maintainer-feedback?(netchild@FreeBSD.org)

Created attachment 166113
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D166113&action=
=3Dedit
Fix lame's configure script to correctly detect SSE support

During the exp-run in bug 206074, it was found that audio/lame gives errors
with a recent clang 3.8.0 snapshot, but only on i386 [1]:

xmm_quantize_sub.c:65:34: error: always_inline function '_mm_loadu_ps' requ=
ires
target feature 'mmx', but would be inlined into function 'init_xrpow_core_s=
se'
that is compiled without support for 'mmx'
    const __m128 vec_fabs_mask =3D _mm_loadu_ps(&fabs_mask._float[0]);
                                 ^

And many more of such errors, in lame's SSE (vector) support routines.  The
actual message is a little misleading, as it is really SSE support that is
missing.  E.g., the program is compiled on i386-freebsd, which has i486 as
default target CPU, but there is no -msse flag on the command line.  (Note =
that
these messages go away if you set CPUTYPE to a CPU which does support SSE.)

When you compile with recent versions of gcc (4.9 and higher), you get simi=
lar
errors:

In file included from xmm_quantize_sub.c:37:0:
/usr/local/lib/gcc49/gcc/i386-portbld-freebsd11.0/4.9.4/include/xmmintrin.h=
:929:1:
error: inlining failed in call to always_inline '_mm_loadu_ps': target spec=
ific
option mismatch
 _mm_loadu_ps (float const *__P)
 ^

The cause is that lame's configure script simply checks for the existence of
<xmmintrin.h>, and if it exists, and can be compiled, it assumes SSE intrin=
sics
are available.  This is not generally true anymore, because recent versions=
 of
gcc and clang removed the #ifdef __SSE__ checks from their xmmintrin.h file=
s,
and therefore a test program which only does "#include <xmmintrin.h>" will
always compile, even if SSE support is turned off.

I have attempted to fix lame's configure.in and configure scripts, by letti=
ng
them compile a function which actually calls an SSE intrinsic.  It works
correctly for me, but my knowledge of autoconf is limited, so a double-chec=
k by
an expert would be nice.

This should probably be upstreamed too.

[1]
http://package18.nyi.freebsd.org/data/headi386PR206074-default/2016-01-17_0=
7h20m29s/logs/errors/lame-3.99.5_2.log

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-206620-13>