From 9556fffdef0e744b5ddc18289d3b44015758a0a9 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 16 May 2016 13:18:46 -0500 Subject: [PATCH] fix x86 sse2 runtime detection tried and failed doing the same for arm neon support --- ...-audio-processing-0.2-no_sse2_x86-ac.patch | 12 ------- webrtc-audio-processing-0.2-no_sse2_x86.patch | 12 ------- webrtc-audio-processing-0.2-x86_msse2.patch | 15 ++++++++ ...ssing-0.2-x86_sse2_runtime_detection.patch | 12 +++++++ webrtc-audio-processing.spec | 34 +++++++++++-------- 5 files changed, 47 insertions(+), 38 deletions(-) delete mode 100644 webrtc-audio-processing-0.2-no_sse2_x86-ac.patch delete mode 100644 webrtc-audio-processing-0.2-no_sse2_x86.patch create mode 100644 webrtc-audio-processing-0.2-x86_msse2.patch create mode 100644 webrtc-audio-processing-0.2-x86_sse2_runtime_detection.patch diff --git a/webrtc-audio-processing-0.2-no_sse2_x86-ac.patch b/webrtc-audio-processing-0.2-no_sse2_x86-ac.patch deleted file mode 100644 index 66a30ff..0000000 --- a/webrtc-audio-processing-0.2-no_sse2_x86-ac.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up webrtc-audio-processing-0.2/configure.ac.no_sse2_x86 webrtc-audio-processing-0.2/configure.ac ---- webrtc-audio-processing-0.2/configure.ac.no_sse2_x86 2015-11-04 01:49:34.000000000 -0600 -+++ webrtc-audio-processing-0.2/configure.ac 2016-05-13 11:55:30.199168174 -0500 -@@ -56,7 +56,7 @@ AS_CASE(["${host}"], - AC_SUBST(PLATFORM_CFLAGS) - - AS_CASE(["${host_cpu}"], -- [i?86|x86_64], -+ [x86_64], - [ - HAVE_X86=1 - ], diff --git a/webrtc-audio-processing-0.2-no_sse2_x86.patch b/webrtc-audio-processing-0.2-no_sse2_x86.patch deleted file mode 100644 index 28759a0..0000000 --- a/webrtc-audio-processing-0.2-no_sse2_x86.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up webrtc-audio-processing-0.2/configure.no_sse2_x86 webrtc-audio-processing-0.2/configure ---- webrtc-audio-processing-0.2/configure.no_sse2_x86 2015-11-04 01:50:11.000000000 -0600 -+++ webrtc-audio-processing-0.2/configure 2016-05-13 11:55:38.964203868 -0500 -@@ -16104,7 +16104,7 @@ esac - - - case "${host_cpu}" in #( -- i?86|x86_64) : -+ x86_64) : - - HAVE_X86=1 - ;; #( diff --git a/webrtc-audio-processing-0.2-x86_msse2.patch b/webrtc-audio-processing-0.2-x86_msse2.patch new file mode 100644 index 0000000..138a2eb --- /dev/null +++ b/webrtc-audio-processing-0.2-x86_msse2.patch @@ -0,0 +1,15 @@ +diff -up webrtc-audio-processing-0.2/configure.ac.x86_sse2 webrtc-audio-processing-0.2/configure.ac +--- webrtc-audio-processing-0.2/configure.ac.x86_sse2 2015-11-04 01:49:34.000000000 -0600 ++++ webrtc-audio-processing-0.2/configure.ac 2016-05-16 12:27:16.640796437 -0500 +@@ -56,6 +56,11 @@ AS_CASE(["${host}"], + AC_SUBST(PLATFORM_CFLAGS) + + AS_CASE(["${host_cpu}"], ++ [i?86], ++ [ ++ HAVE_X86=1 ++ ARCH_CFLAGS="-msse2" ++ ], + [i?86|x86_64], + [ + HAVE_X86=1 diff --git a/webrtc-audio-processing-0.2-x86_sse2_runtime_detection.patch b/webrtc-audio-processing-0.2-x86_sse2_runtime_detection.patch new file mode 100644 index 0000000..4e0045a --- /dev/null +++ b/webrtc-audio-processing-0.2-x86_sse2_runtime_detection.patch @@ -0,0 +1,12 @@ +diff -up webrtc-audio-processing-0.2/webrtc/common_audio/fir_filter.cc.x86_sse2 webrtc-audio-processing-0.2/webrtc/common_audio/fir_filter.cc +--- webrtc-audio-processing-0.2/webrtc/common_audio/fir_filter.cc.x86_sse2 2015-11-19 06:41:44.000000000 -0600 ++++ webrtc-audio-processing-0.2/webrtc/common_audio/fir_filter.cc 2016-05-16 12:31:21.558877588 -0500 +@@ -45,7 +45,7 @@ FIRFilter* FIRFilter::Create(const float + FIRFilter* filter = NULL; + // If we know the minimum architecture at compile time, avoid CPU detection. + #if defined(WEBRTC_ARCH_X86_FAMILY) +-#if defined(__SSE2__) ++#if 0 //defined(__SSE2__) + filter = + new FIRFilterSSE2(coefficients, coefficients_length, max_input_length); + #else diff --git a/webrtc-audio-processing.spec b/webrtc-audio-processing.spec index cb3c187..9ceb4ee 100644 --- a/webrtc-audio-processing.spec +++ b/webrtc-audio-processing.spec @@ -1,8 +1,4 @@ -%ifarch %{arm} -%global neon --enable-neon=no -%endif - Name: webrtc-audio-processing Version: 0.2 Release: 2%{?dist} @@ -12,12 +8,9 @@ License: BSD URL: http://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/ Source0: http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/%{name}-%{version}.tar.xz Patch0: webrtc-fix-typedefs-on-other-arches.patch -# can't use sse2 on %%ix86 in fedora -Patch1: webrtc-audio-processing-0.2-no_sse2_x86.patch -# match for patch1 when autoreconf'ing (unused, so far) -Patch10: webrtc-audio-processing-0.2-no_sse2_x86-ac.patch - -Patch2: webrtc-audio-processing-0.2-no_undefined.patch +Patch1: webrtc-audio-processing-0.2-no_undefined.patch +Patch2: webrtc-audio-processing-0.2-x86_msse2.patch +Patch3: webrtc-audio-processing-0.2-x86_sse2_runtime_detection.patch BuildRequires: automake libtool @@ -37,15 +30,27 @@ files for developing applications that use %{name}. %prep %setup -q %patch0 -p1 -b .typedef -%patch1 -p1 -b .no_sse2_x86 -%patch10 -p1 -b .no_sse2_x86_ac -%patch2 -p1 -b .no_undefined +%patch1 -p1 -b .no_undefined +%patch2 -p1 -b .x86_msse2 +%ifarch %{ix86} +%patch3 -p1 -b .x86_sse2_runtime_detection +%endif -# for patch10/patch2 +# for patch1/patch2 autoreconf -fi %build + +%ifarch %{arm} +# disable neon support +# can't unconditionally enable neon, and --enable-neon=runtime is broken (WebRtc_GetCPUFeaturesARM is unimplemented) +%global neon --enable-neon=no +## hack to ensure -mfpu=neon flag appears last when using --enable-neon=yes|runtime +#export CFLAGS="%{optflags} -mfpu=neon" +#export CXXFLAGS="%{optflags} -mfpu=neon" +%endif + %configure \ %{?neon} \ --disable-silent-rules \ @@ -76,6 +81,7 @@ rm -fv %{buildroot}%{_libdir}/lib*.la %changelog * Mon May 16 2016 Rex Dieter - 0.2-2 - link w/ --no-undefined +- fix x86 sse2 runtime detection * Thu May 12 2016 Rex Dieter - 0.2-1 - webrtc-audio-processing-0.2 (#1335536)