Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 460570

Summary: media-lib/spandsp-0.0.6_pre21: readd CPU USE flags
Product: Gentoo Linux Reporter: Andrew Savchenko <bircoph>
Component: [OLD] LibraryAssignee: Matt Turner <mattst88>
Status: RESOLVED FIXED    
Severity: normal CC: voip+disabled
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: spandsp-0.0.6_pre21.ebuild.diff
metadata.xml.diff
spandsp-0.0.6_pre21-sse4x.patch
spandsp-0.0.6_pre21.ebuild.diff

Description Andrew Savchenko gentoo-dev 2013-03-06 18:30:15 UTC
Hello,

CPU-related USE flags (SSE* in particular) were dropped from spandsp per bug 371991 due to SSE4 ambiguity.

However, in the latest 0.0.6_pre21 version SSE4-related flags are separated for SSE4.1, SSE4.2 and SSE4a. Please note, that these configure flags not only add -msse* compiler flags, but also control GCC intrinsics inside the code, thus they can't be replaced by user's CFLAGS alone.

So, please, restore all flags, attaches patches does this. SSE5 is omitted because the latest stable gcc-4.6.3 doesn't support it yet.
Comment 1 Andrew Savchenko gentoo-dev 2013-03-06 18:30:39 UTC
Created attachment 341142 [details, diff]
spandsp-0.0.6_pre21.ebuild.diff
Comment 2 Andrew Savchenko gentoo-dev 2013-03-06 18:30:57 UTC
Created attachment 341144 [details, diff]
metadata.xml.diff
Comment 3 Matt Turner gentoo-dev 2013-03-06 18:45:27 UTC
(In reply to comment #0)
> Hello,
> 
> CPU-related USE flags (SSE* in particular) were dropped from spandsp per bug
> 371991 due to SSE4 ambiguity.
> 
> However, in the latest 0.0.6_pre21 version SSE4-related flags are separated
> for SSE4.1, SSE4.2 and SSE4a. Please note, that these configure flags not
> only add -msse* compiler flags, but also control GCC intrinsics inside the
> code, thus they can't be replaced by user's CFLAGS alone.

Ah indeed, sorry I missed that.

> So, please, restore all flags, attaches patches does this. SSE5 is omitted
> because the latest stable gcc-4.6.3 doesn't support it yet.

And it never will, since SSE5 will never exist on real silicon...
Comment 4 Andrew Savchenko gentoo-dev 2013-03-10 17:26:48 UTC
Created attachment 341576 [details, diff]
spandsp-0.0.6_pre21-sse4x.patch

spandsp fails with sse41 and sse42, because wrong gcc options are set in configure:

-msse41 and -msse42 instead of -msse4.1 and -msse4.2 (this is true at least for gcc 4.6 and gcc 4.7, I hadn't check with older versions).

This patch fixes configure.
Comment 5 Andrew Savchenko gentoo-dev 2013-03-10 17:28:16 UTC
Created attachment 341580 [details, diff]
spandsp-0.0.6_pre21.ebuild.diff

Update ebuild to:
1) accomodate sse41/sse42 patch;
2) use EAPI 5.
Comment 6 Matt Turner gentoo-dev 2013-05-06 04:22:05 UTC
Sorry this has taken so long.

After deleting build system things (config*, Makefile*) I see

[mattst88:~/spandsp-0.0.6] % grep -r _USE_SSE * | sort -u
src/complex_vector_float.c:#if defined(__GNUC__)  &&  defined(SPANDSP_USE_SSE3)
src/mmx_sse_decs.h:#if defined(SPANDSP_USE_SSE)
src/mmx_sse_decs.h:#if defined(SPANDSP_USE_SSE2)
src/mmx_sse_decs.h:#if defined(SPANDSP_USE_SSE3)
src/mmx_sse_decs.h:#if defined(SPANDSP_USE_SSE4_1)
src/mmx_sse_decs.h:#if defined(SPANDSP_USE_SSE4_2)
src/mmx_sse_decs.h:#if defined(SPANDSP_USE_SSE4A)
src/mmx_sse_decs.h:#if defined(SPANDSP_USE_SSE5)
src/vector_float.c:#if defined(__GNUC__)  &&  defined(SPANDSP_USE_SSE2)

The preprocessor checks in src/mmx_sse_decs.h simply guard the inclusion of *mmintrin.h headers and don't control any code.

As such, it looks to me that only SSE2 and SSE3 (and MMX) are actually useful flags.

I added back MMX, SSE2, and SSE3 use flags, but didn't commit the SSE4 patch or metadata change since they're not necessary with just these flags.

Let me know if anything seems not right to you. Thanks a bunch for the bug and your patience.