Blob Blame History Raw
diff --git a/aconfigure.ac b/aconfigure.ac
index 781b01b..9f865c9 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -1974,6 +1974,24 @@ AC_SUBST(ac_no_webrtc)
 AC_SUBST(ac_webrtc_instset)
 AC_SUBST(ac_webrtc_cflags)
 AC_SUBST(ac_webrtc_ldflags)
+
+AC_MSG_CHECKING(for available instruction set)
+AC_LINK_IFELSE([
+	AC_LANG_PROGRAM([[
+		#include <xmmintrin.h>
+		__m128 testfunc(float *a, float *b) {
+			return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
+		}
+	]])],
+	[
+		instrset=sse2
+	],
+	[
+		instrset=generic
+	]
+)
+AC_MSG_RESULT($instrset)
+
 AC_ARG_ENABLE(libwebrtc,
 	      AS_HELP_STRING([--disable-libwebrtc],
 			     [Exclude libwebrtc in the build]),
@@ -1995,7 +2013,7 @@ AC_ARG_ENABLE(libwebrtc,
 				ac_webrtc_instset=neon
 			    	;;
 			    *)
-				ac_webrtc_instset=sse2
+				ac_webrtc_instset=$instrset
 			    	;;
 			esac
 		        ;;
@@ -2020,7 +2038,7 @@ AC_ARG_ENABLE(libwebrtc,
 			    	ac_webrtc_instset=mips
 			        ;;
 			    *)
-				ac_webrtc_instset=sse2
+				ac_webrtc_instset=$instrset
 			    	;;
 			esac
 		        ;;
@@ -2035,7 +2053,7 @@ AC_ARG_ENABLE(libwebrtc,
                                  ac_webrtc_cflags="-DWEBRTC_ARCH_ARMV7 -mfloat-abi=hard -mfpu=neon"
                                  ;;
                              *)
-                                 ac_webrtc_instset=sse2
+                                 ac_webrtc_instset=$instrset
                                  ;;
                          esac
 			;;
diff --git a/third_party/build/os-auto.mak.in b/third_party/build/os-auto.mak.in
index 22defec..0e1f7a7 100644
--- a/third_party/build/os-auto.mak.in
+++ b/third_party/build/os-auto.mak.in
@@ -112,8 +112,7 @@ else ifneq ($(findstring mips,@ac_webrtc_instset@),)
 else # Generic fixed point
     WEBRTC_SRC = \
 	      modules/audio_processing/aecm/aecm_core_c.o                \
-	      modules/audio_processing/ns/nsx_core_c.o                   \
-	      common_audio/signal_processing/complex_fft.o
+	      modules/audio_processing/ns/nsx_core_c.o
 endif
 endif
 endif
diff --git a/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_core.c b/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_core.c
index 9d54b62..71536f6 100644
--- a/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_core.c
+++ b/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_core.c
@@ -1478,7 +1478,7 @@ AecCore* WebRtcAec_CreateAec() {
   WebRtcAec_ComfortNoise = ComfortNoise;
   WebRtcAec_SubbandCoherence = SubbandCoherence;
 
-#if defined(WEBRTC_ARCH_X86_FAMILY)
+#if defined(WEBRTC_ARCH_X86_FAMILY) && defined(__SSE2__)
   if (WebRtc_GetCPUInfo(kSSE2)) {
     WebRtcAec_InitAec_SSE2();
   }
diff --git a/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_rdft.c b/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_rdft.c
index 2c3cff2..f02d990 100644
--- a/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_rdft.c
+++ b/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_rdft.c
@@ -571,7 +571,7 @@ void aec_rdft_init(void) {
   cftfsub_128 = cftfsub_128_C;
   cftbsub_128 = cftbsub_128_C;
   bitrv2_128 = bitrv2_128_C;
-#if defined(WEBRTC_ARCH_X86_FAMILY)
+#if defined(WEBRTC_ARCH_X86_FAMILY) && defined(__SSE2__)
   if (WebRtc_GetCPUInfo(kSSE2)) {
     aec_rdft_init_sse2();
   }