From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: buildroot@buildroot.org
Cc: Pierre-Jean Texier <texier.pj2@gmail.com>,
linux-amarula@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>
Subject: [Buildroot] [PATCH v2] package/libxml2: fix compilation with uclibc
Date: Fri, 20 Dec 2024 14:18:47 +0100 [thread overview]
Message-ID: <20241220131847.3380466-1-dario.binacchi@amarulasolutions.com> (raw)
The patch fixes the following errors and warnings raised by the
compilation of the library with uClibc:
encoding.c: In function ‘xmlEncInputChunk’:
encoding.c:2209:32: warning: comparison between pointer and integer
2209 | else if (handler->iconv_in != NULL) {
| ^~
encoding.c: In function ‘xmlEncOutputChunk’:
encoding.c:2269:33: warning: comparison between pointer and integer
2269 | else if (handler->iconv_out != NULL) {
| ^~
encoding.c: In function ‘xmlCharEncCloseFunc’:
encoding.c:2681:29: warning: comparison between pointer and integer
2681 | if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) {
| ^~
encoding.c:2681:60: warning: comparison between pointer and integer
2681 | if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) {
| ^~
encoding.c:2683:32: warning: comparison between pointer and integer
2683 | if (handler->iconv_out != NULL) {
| ^~
encoding.c:2686:32: error: assignment to ‘iconv_t’ {aka ‘long int’} from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
2686 | handler->iconv_out = NULL;
| ^
encoding.c:2688:31: warning: comparison between pointer and integer
2688 | if (handler->iconv_in != NULL) {
| ^~
encoding.c:2691:31: error: assignment to ‘iconv_t’ {aka ‘long int’} from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
2691 | handler->iconv_in = NULL;
| ^
make[4]: *** [Makefile:1147: libxml2_la-encoding.lo] Error 1
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
Changes v1 -> v2:
- Update the patch to the merged one
.../0001-Fix-compilation-with-uclibc.patch | 114 ++++++++++++++++++
1 file changed, 114 insertions(+)
create mode 100644 package/libxml2/0001-Fix-compilation-with-uclibc.patch
diff --git a/package/libxml2/0001-Fix-compilation-with-uclibc.patch b/package/libxml2/0001-Fix-compilation-with-uclibc.patch
new file mode 100644
index 000000000000..857f6ca2a2a1
--- /dev/null
+++ b/package/libxml2/0001-Fix-compilation-with-uclibc.patch
@@ -0,0 +1,114 @@
+From fc72e0833a4e5724aef604e2fd9adb1014cb4844 Mon Sep 17 00:00:00 2001
+From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+Date: Mon, 16 Dec 2024 17:23:23 +0100
+Subject: [PATCH] Fix compilation with uclibc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The patch fixes the following errors and warnings raised by the
+compilation of the library with uClibc:
+
+encoding.c: In function ‘xmlEncInputChunk’:
+encoding.c:2209:32: warning: comparison between pointer and integer
+ 2209 | else if (handler->iconv_in != NULL) {
+ | ^~
+encoding.c: In function ‘xmlEncOutputChunk’:
+encoding.c:2269:33: warning: comparison between pointer and integer
+ 2269 | else if (handler->iconv_out != NULL) {
+ | ^~
+encoding.c: In function ‘xmlCharEncCloseFunc’:
+encoding.c:2681:29: warning: comparison between pointer and integer
+ 2681 | if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) {
+ | ^~
+encoding.c:2681:60: warning: comparison between pointer and integer
+ 2681 | if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) {
+ | ^~
+encoding.c:2683:32: warning: comparison between pointer and integer
+ 2683 | if (handler->iconv_out != NULL) {
+ | ^~
+encoding.c:2686:32: error: assignment to ‘iconv_t’ {aka ‘long int’} from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
+ 2686 | handler->iconv_out = NULL;
+ | ^
+encoding.c:2688:31: warning: comparison between pointer and integer
+ 2688 | if (handler->iconv_in != NULL) {
+ | ^~
+encoding.c:2691:31: error: assignment to ‘iconv_t’ {aka ‘long int’} from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
+ 2691 | handler->iconv_in = NULL;
+ | ^
+make[4]: *** [Makefile:1147: libxml2_la-encoding.lo] Error 1
+
+Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+Upstream: https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/292
+---
+ encoding.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/encoding.c b/encoding.c
+index 14ffafddbc02..41ecde1885e4 100644
+--- a/encoding.c
++++ b/encoding.c
+@@ -1264,7 +1264,7 @@ DECLARE_ISO_FUNCS(16)
+ #endif /* LIBXML_ISO8859X_ENABLED */
+
+ #ifdef LIBXML_ICONV_ENABLED
+- #define EMPTY_ICONV , (iconv_t) 0, (iconv_t) 0
++ #define EMPTY_ICONV , (iconv_t) -1, (iconv_t) -1
+ #else
+ #define EMPTY_ICONV
+ #endif
+@@ -1389,8 +1389,8 @@ xmlNewCharEncodingHandler(const char *name,
+ handler->name = up;
+
+ #ifdef LIBXML_ICONV_ENABLED
+- handler->iconv_in = NULL;
+- handler->iconv_out = NULL;
++ handler->iconv_in = (iconv_t) -1;
++ handler->iconv_out = (iconv_t) -1;
+ #endif
+ #ifdef LIBXML_ICU_ENABLED
+ handler->uconv_in = NULL;
+@@ -2200,7 +2200,7 @@ xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
+ }
+ }
+ #ifdef LIBXML_ICONV_ENABLED
+- else if (handler->iconv_in != NULL) {
++ else if (handler->iconv_in != (iconv_t) -1) {
+ ret = xmlIconvWrapper(handler->iconv_in, out, outlen, in, inlen);
+ }
+ #endif /* LIBXML_ICONV_ENABLED */
+@@ -2260,7 +2260,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
+ }
+ }
+ #ifdef LIBXML_ICONV_ENABLED
+- else if (handler->iconv_out != NULL) {
++ else if (handler->iconv_out != (iconv_t) -1) {
+ ret = xmlIconvWrapper(handler->iconv_out, out, outlen, in, inlen);
+ }
+ #endif /* LIBXML_ICONV_ENABLED */
+@@ -2672,17 +2672,17 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
+ * Iconv handlers can be used only once, free the whole block.
+ * and the associated icon resources.
+ */
+- if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) {
++ if ((handler->iconv_out != (iconv_t) -1) || (handler->iconv_in != (iconv_t) -1)) {
+ tofree = 1;
+- if (handler->iconv_out != NULL) {
++ if (handler->iconv_out != (iconv_t) -1) {
+ if (iconv_close(handler->iconv_out))
+ ret = -1;
+- handler->iconv_out = NULL;
++ handler->iconv_out = (iconv_t) -1;
+ }
+- if (handler->iconv_in != NULL) {
++ if (handler->iconv_in != (iconv_t) -1) {
+ if (iconv_close(handler->iconv_in))
+ ret = -1;
+- handler->iconv_in = NULL;
++ handler->iconv_in = (iconv_t) -1;
+ }
+ }
+ #endif /* LIBXML_ICONV_ENABLED */
+--
+2.43.0
+
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2024-12-20 13:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 13:18 Dario Binacchi [this message]
2024-12-26 22:52 ` [Buildroot] [PATCH v2] package/libxml2: fix compilation with uclibc Thomas Petazzoni via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241220131847.3380466-1-dario.binacchi@amarulasolutions.com \
--to=dario.binacchi@amarulasolutions.com \
--cc=buildroot@buildroot.org \
--cc=linux-amarula@amarulasolutions.com \
--cc=texier.pj2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox