From: Martin Jansa <[email protected]>

* fixes build issue when dnn PACKAGECONFIG is enabled and ld-is-gold in 
DISTRO_FEATURES

Signed-off-by: Martin Jansa <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
(cherry picked from commit 41ca2e57bc2e00ca8db577c6e311ab2e8f39b7aa)
Signed-off-by: Armin Kuster <[email protected]>
---
 .../opencv/0001-sfm-link-with-Glog_LIBS.patch | 44 +++++++++++++++++++
 .../recipes-support/opencv/opencv_4.5.2.bb    |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 
meta-oe/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch

diff --git 
a/meta-oe/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch 
b/meta-oe/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch
new file mode 100644
index 00000000000..7b2c4100a25
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch
@@ -0,0 +1,44 @@
+From ffe20fc4ec46c6b491eff29a38f90686d4d035f6 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <[email protected]>
+Date: Mon, 12 Apr 2021 20:37:40 +0000
+Subject: [PATCH] sfm: link with Glog_LIBS
+
+* in 4.5.0 there was explicit linkage with GLOG_LIBRARY, but since 4.5.1 with:
+  
https://github.com/opencv/opencv_contrib/commit/23ee62a19b7a3e50d6dbf295359d8b1aff2e03fd
+
+  it's gone, probably because Glog_FOUND is already set from Ceres,
+  but then GLOG_LIBRARIES is empty in LIBMV_LIGHT_LIBS and build with gold 
fails:
+
+lib/libopencv_sfm.so.4.5.2: error: undefined reference to 
'google::LogMessage::stream()'
+lib/libopencv_sfm.so.4.5.2: error: undefined reference to 
'google::LogMessage::~LogMessage()'
+lib/libopencv_sfm.so.4.5.2: error: undefined reference to 
'google::kLogSiteUninitialized'
+lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'fLI::FLAGS_v'
+lib/libopencv_sfm.so.4.5.2: error: undefined reference to 
'google::InitVLOG3__(int**, int*, char const*, int)'
+lib/libopencv_sfm.so.4.5.2: error: undefined reference to 
'google::LogMessageFatal::LogMessageFatal(char const*, int)'
+lib/libopencv_sfm.so.4.5.2: error: undefined reference to 
'google::LogMessageFatal::~LogMessageFatal()'
+collect2: error: ld returned 1 exit status
+
+  Add Glog_LIBS which is set to the same value as GLOG_LIBRARIES used to be.
+
+Upstream-Status: Submitted [https://github.com/opencv/opencv_contrib/pull/2923]
+
+Signed-off-by: Martin Jansa <[email protected]>
+---
+ modules/sfm/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/modules/sfm/CMakeLists.txt b/modules/sfm/CMakeLists.txt
+index 045a1fe6e..ee7cecdac 100644
+--- a/modules/sfm/CMakeLists.txt
++++ b/modules/sfm/CMakeLists.txt
+@@ -84,6 +84,7 @@ set(LIBMV_LIGHT_LIBS
+   multiview
+   numeric
+   ${GLOG_LIBRARIES}
++  ${Glog_LIBS}
+   ${GFLAGS_LIBRARIES}
+ )
+ 
diff --git a/meta-oe/recipes-support/opencv/opencv_4.5.2.bb 
b/meta-oe/recipes-support/opencv/opencv_4.5.2.bb
index 04ab8075402..311355bd7a5 100644
--- a/meta-oe/recipes-support/opencv/opencv_4.5.2.bb
+++ b/meta-oe/recipes-support/opencv/opencv_4.5.2.bb
@@ -51,6 +51,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
            file://0001-Dont-use-isystem.patch \
            file://download.patch \
            file://0001-Make-ts-module-external.patch \
+           file://0001-sfm-link-with-Glog_LIBS.patch;patchdir=../contrib \
            "
 SRC_URI_append_riscv64 = " 
file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=../contrib"
 
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#90906): 
https://lists.openembedded.org/g/openembedded-devel/message/90906
Mute This Topic: https://lists.openembedded.org/mt/82174134/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to