[meta-oe] opencv: disable sse4.1 and sse4.2 on x86

Message ID 20220214105337.24477-1-mingli.yu@windriver.com
State New
Headers show
Series [meta-oe] opencv: disable sse4.1 and sse4.2 on x86 | expand

Commit Message

Yu, Mingli Feb. 14, 2022, 10:53 a.m. UTC
From: Mingli Yu <mingli.yu@windriver.com>

Disable sse4.1 and sse4.2 on x86 to fix the below build failure [1].
 | ./opencv-4.5.5/git/modules/gapi/src/backends/fluid/gfluidcore_simd_sse41.hpp:387:47: error: '_mm_insert_epi64' was not declared in this scope; did you mean '_mm_insert_epi8'?
 387 | val_0 = _mm_unpacklo_epi8(_mm_insert_epi64(val_0, reinterpret_cast<const int64_t>(&tmp[4 * (chanNum * mapsx[x + 1] + 1)]), 0), zero);
 | ^~~~~~~~~~~~~~~~
 | _mm_insert_epi8

[1] https://github.com/opencv/opencv/issues/21597

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 meta-oe/recipes-support/opencv/opencv_4.5.5.bb | 3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/meta-oe/recipes-support/opencv/opencv_4.5.5.bb b/meta-oe/recipes-support/opencv/opencv_4.5.5.bb
index 9627190bd..a3affa701 100644
--- a/meta-oe/recipes-support/opencv/opencv_4.5.5.bb
+++ b/meta-oe/recipes-support/opencv/opencv_4.5.5.bb
@@ -100,6 +100,9 @@  EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
     ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \
 "
 EXTRA_OECMAKE:append:x86 = " -DX86=ON"
+# disable sse4.1 and sse4.2 to fix 32bit build failure
+# https://github.com/opencv/opencv/issues/21597
+EXTRA_OECMAKE:remove:x86 = " -DENABLE_SSE41=1 -DENABLE_SSE42=1"
 
 PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \
     ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \