Skip to contentSkip to conversation

package/libiio: fix build with libxml2 >= 2.12

PATCH Applied Fabrice Fontaine 2 participants 2 messages Dec 29, 2023 – Jan 1, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libiio: fix build with libxml2 >= 2.12

Fix the following build failure raised since bump of libxml2 to version 2.12.1 in commit d8ac52108c12f0fcc9641b63e7922009270f96c6:

/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c: In function 'xml_create_context':
/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c:481:15: warning: implicit declaration of function 'xmlReadFile' [-Wimplicit-function-declaration]

  481 |         doc = xmlReadFile(xml_file, NULL, XML_PARSE_DTDVALID);
      |               ^~~~~~~~~~~
/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c:481:43: error: 'XML_PARSE_DTDVALID' undeclared (first use in this function); did you mean 'XML_DOC_DTDVALID'?
  481 |         doc = xmlReadFile(xml_file, NULL, XML_PARSE_DTDVALID);
      |                                           ^~~~~~~~~~~~~~~~~~
      |                                           XML_DOC_DTDVALID

Fixes:
- http://autobuild.buildroot.org/results/f97c2db33e07a02699e4650caf97de5f3c475eb8

---
 ...l-Fix-compatibility-with-libxml-2-12.patch | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/libiio/0001-xml-Fix-compatibility-with-libxml-2-12.patch
package/libiio/0001-xml-Fix-compatibility-with-libxml-2-12.patch new file +33 -0
new file mode 100644
index 0000000000..56c272aad3
@@ -0,0 +1,33 @@
+From b1170cacff24cdfd3858edc2285c51cadef11488 Mon Sep 17 00:00:00 2001
+From: Jan Tojnar <[email protected]>
+Date: Sun, 10 Dec 2023 21:52:05 +0100
+Subject: [PATCH] xml: Fix compatibility with libxml 2.12
+
+libxml 2.12.0 reorganized includes, resulting in the following no longer being in scope:
+
+- XML_PARSE_DTDVALID
+- xmlReadMemory
+- xmlReadFile
+- xmlCleanupParser
+
+Signed-off-by: Jan Tojnar <[email protected]>
+(cherry picked from commit bb688d04294dda45e68dfaf13e3bc1187841e52a)
+
+Upstream: https://github.com/analogdevicesinc/libiio/commit/b1170cacff24cdfd3858edc2285c51cadef11488
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ xml.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/xml.c b/xml.c
+index 33f026103..3eaed92b3 100644
+--- a/xml.c
++++ b/xml.c
+@@ -10,6 +10,7 @@
+ #include "iio-private.h"
+ 
+ #include <errno.h>
++#include <libxml/parser.h>
+ #include <libxml/tree.h>
+ #include <string.h>
+ 
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 12 lines · On Fri, 29 Dec 2023 23:04:27 +0100 Fabrice Fontaine…

Fix the following build failure raised since bump of libxml2 to version 2.12.1 in commit d8ac52108c12f0fcc9641b63e7922009270f96c6:

/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c: In function 'xml_create_context':
/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c:481:15: warning: implicit declaration of function 'xmlReadFile' [-Wimplicit-function-declaration]

  481 |         doc = xmlReadFile(xml_file, NULL, XML_PARSE_DTDVALID);
      |               ^~~~~~~~~~~
/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c:481:43: error: 'XML_PARSE_DTDVALID' undeclared (first use in this function); did you mean 'XML_DOC_DTDVALID'?
  481 |         doc = xmlReadFile(xml_file, NULL, XML_PARSE_DTDVALID);
      |                                           ^~~~~~~~~~~~~~~~~~
      |                                           XML_DOC_DTDVALID
Quoted 8 lines

Fixes:
- http://autobuild.buildroot.org/results/f97c2db33e07a02699e4650caf97de5f3c475eb8

---
 ...l-Fix-compatibility-with-libxml-2-12.patch | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/libiio/0001-xml-Fix-compatibility-with-libxml-2-12.patch

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot