From 424e8dae21ef94c6e7792d8175bd75ca3aa30bf5 Mon Sep 17 00:00:00 2001
From: philippegorley <philippe.gorley@savoirfairelinux.com>
Date: Thu, 6 Jul 2017 15:49:04 -0400
Subject: [PATCH] vpx: enable runtime cpu detection
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Older PCs may not support all instruction set extensions. If Ring was
built on a newer PC, this can cause a SIGILL crash when running on an
older PC.

Keep it disabled on Android and iOS, as they have no CPU detection
method available.

For example, the Core i5-2520M (Lenovo L520) does not support avx2.

Change-Id: I5bf6507ef174e18202fc6867772cd0a6be385388
Reviewed-by: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
---
 contrib/src/vpx/rules.mak | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index 48aa7586a5..21141252e6 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -91,9 +91,15 @@ VPX_CONF := \
 	--disable-install-docs \
 	--enable-realtime-only \
 	--enable-error-concealment \
-	--disable-runtime-cpu-detect \
 	--disable-webm-io
 
+ifdef HAVE_ANDROID
+	VPX_CONF += --disable-runtime-cpu-detect
+endif
+ifdef HAVE_IOS
+	VPX_CONF += --disable-runtime-cpu-detect
+endif
+
 ifdef HAVE_WIN32
 VPX_CONF +=	--disable-ssse3
 endif
-- 
GitLab