|
| 1 | +From 7d669a90212e105b0f669aa2ab38c987b187baab Mon Sep 17 00:00:00 2001 |
| 2 | +From: Hongxu Jia < [email protected]> |
| 3 | +Date: Wed, 21 May 2025 13:09:25 +0800 |
| 4 | +Subject: [PATCH] fix lttng-tools fails to compile with libxml2 2.14.0+ |
| 5 | + |
| 6 | +Description: |
| 7 | +| In file included from /srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work/core2-32-poky-linux/lttng-tools/2.13.15/recipe-sysroot/usr/include/libxml2/libxml/parser.h:25, |
| 8 | +| from ../../../../lttng-tools-2.13.15/src/common/config/session-config.c:29: |
| 9 | +| /srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work/core2-32-poky-linux/lttng-tools/2.13.15/recipe-sysroot/usr/include/libxml2/libxml/encoding.h:173:7: note: declared here |
| 10 | +| 173 | } input XML_DEPRECATED_MEMBER; |
| 11 | +| | ^~~~~ |
| 12 | +| ../../../../lttng-tools-2.13.15/src/common/config/session-config.c:432:15: error: called object is not a function or function pointer |
| 13 | +| 432 | ret = handler->input(out_str, &out_len, (const xmlChar *) in_str, &in_len); |
| 14 | +| | ^~~~~~~ |
| 15 | +| At top level: |
| 16 | +| cc1: note: unrecognized command-line option '-Wno-incomplete-setjmp-declaration' may have been intended to silence earlier diagnostics |
| 17 | + |
| 18 | +According to [1][2], the UTF-8 handler is |
| 19 | +``` |
| 20 | +static xmlCharEncError |
| 21 | +UTF8ToUTF8(void *vctxt ATTRIBUTE_UNUSED, |
| 22 | + unsigned char* out, int *outlen, |
| 23 | + const unsigned char* in, int *inlen, |
| 24 | + int flush ATTRIBUTE_UNUSED) |
| 25 | +``` |
| 26 | + |
| 27 | +Update input.func with setting ATTRIBUTE_UNUSED params with NULL and 0 |
| 28 | + |
| 29 | +[1] https://gitlab.gnome.org/GNOME/libxml2/-/commit/38f475072aefe032fff1dc058df3e56c1e7062fa |
| 30 | +[2] https://gitlab.gnome.org/GNOME/libxml2/-/commit/69b83bb68e2a8ed0013f80c51b9a358714b00c9a#478024cc18a2cc8dbaed34076e9775f6827f413d_2188_2201 |
| 31 | + |
| 32 | +Signed-off-by: Marko, Peter < [email protected]> |
| 33 | +Signed-off-by: Hongxu Jia < [email protected]> |
| 34 | +--- |
| 35 | + src/common/config/session-config.c | 2 +- |
| 36 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
| 37 | + |
| 38 | +--- a/src/common/config/session-config.c |
| 39 | ++++ b/src/common/config/session-config.c |
| 40 | +@@ -429,7 +429,7 @@ static xmlChar *encode_string(const char |
| 41 | + goto end; |
| 42 | + } |
| 43 | + |
| 44 | +- ret = handler->input(out_str, &out_len, (const xmlChar *) in_str, &in_len); |
| 45 | ++ ret = handler->input.func(NULL, out_str, &out_len, (const xmlChar *) in_str, &in_len, 0); |
| 46 | + if (ret < 0) { |
| 47 | + xmlFree(out_str); |
| 48 | + out_str = NULL; |
0 commit comments