Skip to contentSkip to conversation

opencv: Link with libatomic on mips

PATCH New Khem Raj 1 participant 1 message Jul 7, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 opencv: Link with libatomic on mips

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'

---
 meta-oe/recipes-support/opencv/opencv_4.6.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-support/opencv/opencv_4.6.0.bb +2 -0
index 46f9237753..cbac75e0bd 100644
@@ -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
Signature · 1 line
2.37.0