I was trying to build the opus library with the sse USE flag enabled on a non-sse2 system, and the build failed. I disabled the sse USE flag, and the build succeeded. Apparently the opus library makes use of at least sse2 when sse is enabled. Therefore the sse USE flag ought to be changed to sse2. Otherwise it will lead to build failures on non-sse2 systems which likely have the sse USE flag enabled globally. i686-pc-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2 -I/var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/include -I/var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt -I/var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/silk -I/var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/silk/float -I/var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/silk/fixed -march=athlon-xp -O2 -mno-sse2 -pipe -fvisibility=hidden -W -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -c -o celt/tests/test_unit_mathops.o /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/tests/test_unit_mathops.c In file included from /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/tests/test_unit_mathops.c:48:0: /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/vq.c: In function ‘renormalise_vector’: /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/vq.c:359:4: warning: implicit declaration of function ‘celt_inner_prod_sse’ [-Wimplicit-function-declaration] E = EPSILON + celt_inner_prod(X, X, N, arch); ^ /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/vq.c:359:4: warning: nested extern declaration of ‘celt_inner_prod_sse’ [-Wnested-externs] In file included from /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/tests/test_unit_mathops.c:56:0: /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/x86/pitch_sse.c: At top level: /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/x86/pitch_sse.c:108:12: error: conflicting types for ‘celt_inner_prod_sse’ opus_val32 celt_inner_prod_sse(const opus_val16 *x, const opus_val16 *y, ^ In file included from /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/pitch.h:42:0, from /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/bands.c:44, from /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/tests/test_unit_mathops.c:45: /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/x86/pitch_sse.h:115:15: note: previous implicit declaration of ‘celt_inner_prod_sse’ was here ((void)arch, celt_inner_prod_sse(x, y, N)) ^ /var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2/celt/vq.c:359:18: note: in expansion of macro ‘celt_inner_prod’ E = EPSILON + celt_inner_prod(X, X, N, arch); ^ Makefile:2242: recipe for target 'celt/tests/test_unit_mathops.o' failed make[2]: *** [celt/tests/test_unit_mathops.o] Error 1 make[2]: Leaving directory '/var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2-abi_x86_32.x86' Makefile:2350: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/media-libs/opus-1.1.2/work/opus-1.1.2-abi_x86_32.x86' Makefile:1382: recipe for target 'all' failed make: *** [all] Error 2
Please attach complete build.log and the output of `emerge --info'.
Created attachment 437586 [details] build.log I tried compiling opus both with and without LTO enabled, and I tried using GCC 4.9.3, 5.3.0, and 6.1.0. All failed as long as the sse USE flag was enabled. When I successfully compiled it without the sse USE flag enabled, I was using GCC 6.1.0 and had LTO enabled, so compiler version and flags used appear to not be affecting success or failure of compilation. This failed build log is using GCC 6.1.0 and without LTO -- just basic compiler flags.
Created attachment 437588 [details] emerge --info opus
I took some time to look more closely at the ebuild and Opus' build system and try a few things. Apparently Opus utilizes runtime CPU detection, and when configure is passed --enable-intrinsics, it enables optimizations for sse, sse2, sse4.1, and avx whether the CPU actually supports them or not. So I removed the -mno-sse2 compiler flag (which I had been using because of an issue with QT5), and Opus compiled even with the sse USE flag enabled. So, unless there is any reason to implement a filter-flags option in the ebuild (which may be more trouble than it's worth considering how unlikely it is for anyone to run into this issue), it doesn't appear that there is any need to pursue this issue further.
Sorry, misclicked on status.
does this still apply to media-libs/opus-1.3.1-r1?
We'll tall this a "duplicate" in a kind of lame way of bug 752069 because that's got the patch. *** This bug has been marked as a duplicate of bug 752069 ***
(In reply to Sam James from comment #7) > We'll tall this a "duplicate" in a kind of lame way of bug 752069 because > that's got the patch. > > *** This bug has been marked as a duplicate of bug 752069 *** Oh, wait, it's not a _duplicate_, just related.