Skip to contentSkip to conversation

minifi-cpp: Fix linking with libxml2

PATCH New Khem Raj 1 participant 1 message Aug 18, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 minifi-cpp: Fix linking with libxml2

when libxml2-native is staged, then on x86 it starts to detect that for target and fail to build

---
 ...l2-to-linker-cmdline-of-xml-is-found.patch | 39 +++++++++++++++++++
 .../minifi-cpp/minifi-cpp_0.7.0.bb            |  3 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/minifi-cpp/files/0001-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch
meta-oe/recipes-extended/minifi-cpp/files/0001-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch new file +39 -0
new file mode 100644
index 0000000000..d813b37f99
@@ -0,0 +1,39 @@
+From 609e1745d26d6f42d426018a4dd8d2342d6fc170 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 18 Aug 2020 08:37:57 -0700
+Subject: [PATCH] Add -lxml2 to linker cmdline of xml is found
+
+When cross compiling for systems where static libs
+for libxml are not available cmake's detection mechanism
+resort to linking with libxml.so but doesnt use -lxml2
+liblldbHost.a however requires libxml on linker
+cmdline _after_ itself so its use of symbols from libxml2
+can be resolved. Here check for libxml2 being detected and
+add it if its found.
+
+Fixes
+minifi-cpp/0.7.0-r0/recipe-sysroot-native/usr/lib/libxml2.so is incompatible with elf32-i386
+| clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ thirdparty/libarchive-3.3.2/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/thirdparty/libarchive-3.3.2/CMakeLists.txt b/thirdparty/libarchive-3.3.2/CMakeLists.txt
+index 0c1ea6f7..cde0cc51 100644
+--- a/thirdparty/libarchive-3.3.2/CMakeLists.txt
++++ b/thirdparty/libarchive-3.3.2/CMakeLists.txt
+@@ -1031,7 +1031,7 @@ ENDIF()
+ IF(LIBXML2_FOUND)
+   CMAKE_PUSH_CHECK_STATE()	# Save the state of the variables
+   INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
+-  LIST(APPEND ADDITIONAL_LIBS ${LIBXML2_LIBRARIES})
++  LIST(APPEND ADDITIONAL_LIBS xml2)
+   SET(HAVE_LIBXML2 1)
+   # libxml2's include files use iconv.h
+   SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
+-- 
+2.28.0
+
meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb +2 -1
index 92baa98314..37036ebbb4 100644
@@ -7,7 +7,7 @@ SECTION = "console/network"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=f9534eb5f4ab800b573a37bffc62f3a7"
 
-DEPENDS = "virtual/crypt expat flex python3 bison-native"
+DEPENDS = "virtual/crypt expat flex python3 bison-native libxml2"
 RDEPENDS_${PN} = "python3-core"
 
 SRCREV = "aa42957a2e227df41510047cece3cd606dc1cb6a"
@@ -20,6 +20,7 @@ SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git \
             file://fix-osspuuid-musl-compile.patch \
             file://fix-rocksdb-cross-compile.patch \
             file://remove_const_due_to_std_lock_guard.patch \
+            file://0001-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch \
             file://minifi.service \
             file://systemd-volatile.conf \
             file://sysvinit-volatile.conf \
Signature · 1 line
2.28.0