[meta-oe][PATCH] opencv: Link with libatomic on mips


Khem Raj
 

Fixes linking errors e.g.
parallel.cpp:(.text._ZN3tbb6detail2d19start_forINS1_13blocked_rangeIiEEN2cv12_GLOBAL__N_113ProxyLoopBodyEKNS1_16auto_partitionerEE8finalizeERKNS1_14execution_dataE+0xe8): undefined reference to `__atomic_fetch_add_8'

Signed-off-by: Khem Raj <raj.khem@...>
---
meta-oe/recipes-support/opencv/opencv_4.6.0.bb | 2 ++
1 file changed, 2 insertions(+)

diff --git a/meta-oe/recipes-support/opencv/opencv_4.6.0.bb b/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
index 46f9237753..cbac75e0bd 100644
--- a/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
+++ b/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
@@ -99,6 +99,8 @@ EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
${@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)} \
"
+LDFLAGS:append:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed"
+
EXTRA_OECMAKE:append:x86 = " -DX86=ON"
# disable sse4.1 and sse4.2 to fix 32bit build failure
# https://github.com/opencv/opencv/issues/21597
--
2.37.0

Join openembedded-devel@lists.openembedded.org to automatically receive all group messages.