Skip to contentSkip to conversation

onig: fix gcc 15 build

PATCH Superseded Mikko Rapeli 2 participants 7 messages Apr 28 – Apr 29

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 onig: fix gcc 15 build

With backport from upstream 6.9.10.

---
 ...08dee4a01dee60c4cd67f2e2e46484ef50a5.patch | 138 ++++++++++++++++++
 meta-oe/recipes-support/onig/onig_6.9.9.bb    |   1 +
 2 files changed, 139 insertions(+)
 create mode 100644 meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +138 -0
new file mode 100644
index 0000000000..f0683c2ebd
@@ -0,0 +1,138 @@
+From 5f1408dee4a01dee60c4cd67f2e2e46484ef50a5 Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <[email protected]>
+Date: Mon, 18 Nov 2024 00:18:12 +0900
+Subject: [PATCH] fix #312: Build failure with GCC 15 (C23)
+
+---
+ src/regparse.c | 44 ++++++++++++++++++++++++++++++++++++--------
+ src/st.h       |  9 +--------
+ 2 files changed, 37 insertions(+), 16 deletions(-)
+
+Upstream-Status: Backport [5f1408dee4a01dee60c4cd67f2e2e46484ef50a5]
+Signed-off-by: Mikko Rapeli <[email protected]>
+
+diff --git a/src/regparse.c b/src/regparse.c
+index 24bcbaac..9acdd6e2 100644
+--- a/src/regparse.c
++++ b/src/regparse.c
+@@ -793,8 +793,13 @@ onig_print_names(FILE* fp, regex_t* reg)
+ #endif /* ONIG_DEBUG */
+ 
+ static int
+-i_free_name_entry(UChar* key, NameEntry* e, void* arg ARG_UNUSED)
++i_free_name_entry(st_data_t akey, st_data_t ae, st_data_t arg ARG_UNUSED)
+ {
++  UChar* key;
++  NameEntry* e;
++
++  key = (UChar* )akey;
++  e = (NameEntry* )ae;
+   xfree(e->name);
+   if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs);
+   xfree(key);
+@@ -850,8 +855,14 @@ typedef struct {
+ } INamesArg;
+ 
+ static int
+-i_names(UChar* key ARG_UNUSED, NameEntry* e, INamesArg* arg)
++i_names(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t aarg)
+ {
++  NameEntry* e;
++  INamesArg* arg;
++
++  e = (NameEntry* )ae;
++  arg = (INamesArg* )aarg;
++
+   int r = (*(arg->func))(e->name,
+                          e->name + e->name_len,
+                          e->back_num,
+@@ -883,9 +894,14 @@ onig_foreach_name(regex_t* reg,
+ }
+ 
+ static int
+-i_renumber_name(UChar* key ARG_UNUSED, NameEntry* e, GroupNumMap* map)
++i_renumber_name(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t amap)
+ {
+   int i;
++  NameEntry* e;
++  GroupNumMap* map;
++
++  e = (NameEntry* )ae;
++  map = (GroupNumMap* )amap;
+ 
+   if (e->back_num > 1) {
+     for (i = 0; i < e->back_num; i++) {
+@@ -1374,9 +1390,14 @@ static int CalloutNameIDCounter;
+ #ifdef USE_ST_LIBRARY
+ 
+ static int
+-i_free_callout_name_entry(st_callout_name_key* key, CalloutNameEntry* e,
+-                          void* arg ARG_UNUSED)
++i_free_callout_name_entry(st_data_t akey, st_data_t ae, st_data_t arg ARG_UNUSED)
+ {
++  st_callout_name_key* key;
++  CalloutNameEntry* e;
++
++  key = (st_callout_name_key* )akey;
++  e = (CalloutNameEntry* )ae;
++
+   if (IS_NOT_NULL(e)) {
+     xfree(e->name);
+   }
+@@ -1870,10 +1891,14 @@ typedef intptr_t   CalloutTagVal;
+ #define CALLOUT_TAG_LIST_FLAG_TAG_EXIST     (1<<0)
+ 
+ static int
+-i_callout_callout_list_set(UChar* key, CalloutTagVal e, void* arg)
++i_callout_callout_list_set(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t arg)
+ {
+   int num;
+-  RegexExt* ext = (RegexExt* )arg;
++  CalloutTagVal e;
++  RegexExt* ext;
++
++  e   = (CalloutTagVal )ae;
++  ext = (RegexExt* )arg;
+ 
+   num = (int )e - 1;
+   ext->callout_list[num].flag |= CALLOUT_TAG_LIST_FLAG_TAG_EXIST;
+@@ -1926,8 +1951,11 @@ onig_callout_tag_is_exist_at_callout_num(regex_t* reg, int callout_num)
+ }
+ 
+ static int
+-i_free_callout_tag_entry(UChar* key, CalloutTagVal e, void* arg ARG_UNUSED)
++i_free_callout_tag_entry(st_data_t akey, st_data_t e ARG_UNUSED, st_data_t arg ARG_UNUSED)
+ {
++  UChar* key;
++
++  key = (UChar* )akey;
+   xfree(key);
+   return ST_DELETE;
+ }
+diff --git a/src/st.h b/src/st.h
+index 5efee8bb..70798dc5 100644
+--- a/src/st.h
++++ b/src/st.h
+@@ -34,13 +34,6 @@ enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
+ #ifndef _
+ # define _(args) args
+ #endif
+-#ifndef ANYARGS
+-# ifdef __cplusplus
+-#   define ANYARGS ...
+-# else
+-#   define ANYARGS
+-# endif
+-#endif
+ 
+ st_table *st_init_table _((struct st_hash_type *));
+ st_table *st_init_table_with_size _((struct st_hash_type *, int));
+@@ -52,7 +45,7 @@ int st_delete _((st_table *, st_data_t *, st_data_t *));
+ int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t));
+ int st_insert _((st_table *, st_data_t, st_data_t));
+ int st_lookup _((st_table *, st_data_t, st_data_t *));
+-int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
++int st_foreach _((st_table *, int (*)(st_data_t, st_data_t, st_data_t), st_data_t));
+ void st_add_direct _((st_table *, st_data_t, st_data_t));
+ void st_free_table _((st_table *));
+ void st_cleanup_safe _((st_table *, st_data_t));
meta-oe/recipes-support/onig/onig_6.9.9.bb +1 -0
index b29437db1e..b545fc7596 100644
@@ -11,6 +11,7 @@ SRC_URI = "\
     https://github.com/kkos/oniguruma/releases/download/v${PV}/${BP}.tar.gz \
     file://0001-build-don-t-link-against-host-system-libraries.patch \
     file://0002-build-enable-serial-tests-automake-option-for-ptest.patch \
+    file://5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch \
     file://run-ptest \
 "
 
Signature · 1 line
2.51.0
#1 lore raw

PATCH 2/2 jq: fix build with gcc-15

From: Martin Jansa <[email protected]>

* backport 3 commits to fix:
http://errors.yoctoproject.org/Errors/Details/848831/

../jq-1.7.1/src/builtin.c:1705:4: error: initialization of 'jv (*)(void)' from incompatible pointer type 'jv (*)(jq_state *, jv)' [-Wincompatible-pointer-types]
1705 | {f_ ## name, #name, 1},

      |    ^~
---
 ...c-fix-build-with-Woverlength-strings.patch | 215 +++++++++++++++
 ...-add-and-use-LIBM_DA-and-LIBM_DA_NO-.patch | 164 ++++++++++++
 ...eck-builtin-cfunctions-in-function_l.patch | 249 ++++++++++++++++++
 meta-oe/recipes-devtools/jq/jq_1.7.1.bb       |   3 +
 4 files changed, 631 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/jq/jq/0001-builtin.c-fix-build-with-Woverlength-strings.patch
 create mode 100644 meta-oe/recipes-devtools/jq/jq/0002-libm.h-builtin.c-add-and-use-LIBM_DA-and-LIBM_DA_NO-.patch
 create mode 100644 meta-oe/recipes-devtools/jq/jq/0003-builtin.c-typecheck-builtin-cfunctions-in-function_l.patch
meta-oe/recipes-devtools/jq/jq/0001-builtin.c-fix-build-with-Woverlength-strings.patch new file +215 -0
new file mode 100644
index 0000000000..cd7cdba00c
@@ -0,0 +1,215 @@
+From 8707f8764dfc470d1974eb1d613f5a4bec3610ac Mon Sep 17 00:00:00 2001
+From: Emanuele Torre <[email protected]>
+Date: Fri, 26 Jan 2024 04:42:11 +0100
+Subject: [PATCH] builtin.c: fix build with -Woverlength-strings
+
+C99 only allows string literals long at most 4095 characters.
+jq_builtins was a lot longer than that.
+
+I rewrote all the optional libm error stubs in C so the value of
+jq_builtins is not build dependent.
+
+I replaced the command that generates builtin.inc with a POSIX compliant
+od|sed command that encodes builtin.jq as a comma delimited list of
+octal numbers (that can be embedded in C using a {} literal).
+
+I also added -Woverlength-strings to AM_CFLAGS to verify that the
+problem is fixed.
+
+Fixes #1481
+Upstream-Status: Backport [605836b builtin.c: fix build with -Woverlength-strings]
+Signed-off-by: Martin Jansa <[email protected]>
+---
+
+ Makefile.am   | 10 ++++--
+ src/builtin.c | 86 ++++++++++++++++++++++++---------------------------
+ 2 files changed, 48 insertions(+), 48 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 76e35df..f1f9f2e 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -19,7 +19,8 @@ LIBJQ_SRC = src/builtin.c src/bytecode.c src/compile.c src/execute.c    \
+ 
+ ### C build options
+ 
+-AM_CFLAGS = -Wextra -Wall -Wno-unused-parameter -Wno-unused-function
++AM_CFLAGS = -Wextra -Wall -Wno-unused-parameter -Wno-unused-function \
++            -Woverlength-strings
+ 
+ if WIN32
+ AM_CFLAGS += -municode
+@@ -119,7 +120,12 @@ src/main.c: src/version.h src/config_opts.inc
+ 
+ src/builtin.inc: $(srcdir)/src/builtin.jq
+ 	mkdir -p src
+-	$(AM_V_GEN) sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $(srcdir)/src/builtin.jq > $@
++	$(AM_V_GEN) od -v -A n -t o1 -- $< | \
++	sed -e 's/$$/ /' \
++	    -e 's/\([0123456789]\) /\1, /g' \
++	    -e 's/ $$//' \
++	    -e 's/ 0/  0/g' \
++	    -e 's/ \([123456789]\)/ 0\1/g' > $@
+ src/builtin.o: src/builtin.inc
+ 
+ CLEANFILES = src/version.h .remake-version-h src/builtin.inc src/config_opts.inc
+diff --git a/src/builtin.c b/src/builtin.c
+index 902490d..a3ce7e4 100644
+--- a/src/builtin.c
++++ b/src/builtin.c
+@@ -155,7 +155,11 @@ static jv f_ ## name(jq_state *jq, jv input) { \
+   jv_free(input); \
+   return ret; \
+ }
+-#define LIBM_DD_NO(name)
++#define LIBM_DD_NO(name) \
++static jv f_ ## name(jq_state *jq, jv input) { \
++  jv error = jv_string("Error: " #name "/0 not found at build time"); \
++  return ret_error(input, error); \
++}
+ 
+ #define LIBM_DDD(name) \
+ static jv f_ ## name(jq_state *jq, jv input, jv a, jv b) { \
+@@ -173,7 +177,12 @@ static jv f_ ## name(jq_state *jq, jv input, jv a, jv b) { \
+   jv_free(b); \
+   return ret; \
+ }
+-#define LIBM_DDD_NO(name)
++#define LIBM_DDD_NO(name) \
++static jv f_ ## name(jq_state *jq, jv input, jv a, jv b) { \
++  jv_free(b); \
++  jv error = jv_string("Error: " #name "/2 not found at build time"); \
++  return ret_error2(input, a, error); \
++}
+ 
+ #define LIBM_DDDD(name) \
+ static jv f_ ## name(jq_state *jq, jv input, jv a, jv b, jv c) { \
+@@ -199,7 +208,14 @@ static jv f_ ## name(jq_state *jq, jv input, jv a, jv b, jv c) { \
+   jv_free(c); \
+   return ret; \
+ }
+-#define LIBM_DDDD_NO(name)
++#define LIBM_DDDD_NO(name) \
++static jv f_ ## name(jq_state *jq, jv input, jv a, jv b, jv c) { \
++  jv_free(c) \
++  jv_free(b); \
++  jv error = jv_string("Error: " #name "/3 not found at build time"); \
++  return ret_error2(input, a, error); \
++}
++
+ #include "libm.h"
+ #undef LIBM_DDDD_NO
+ #undef LIBM_DDD_NO
+@@ -226,6 +242,11 @@ static jv f_frexp(jq_state *jq, jv input) {
+   jv_free(input);
+   return ret;
+ }
++#else
++static jv f_frexp(jq_state *jq, jv input) {
++  jv error = jv_string("Error: frexp/0 not found at build time");
++  return ret_error(input, error);
++}
+ #endif
+ #ifdef HAVE_MODF
+ static jv f_modf(jq_state *jq, jv input) {
+@@ -237,6 +258,11 @@ static jv f_modf(jq_state *jq, jv input) {
+   jv_free(input);
+   return jv_array_append(ret, jv_number(i));
+ }
++#else
++static jv f_modf(jq_state *jq, jv input) {
++  jv error = jv_string("Error: modf/0 not found at build time");
++  return ret_error(input, error);
++}
+ #endif
+ #ifdef HAVE_LGAMMA_R
+ static jv f_lgamma_r(jq_state *jq, jv input) {
+@@ -248,6 +274,11 @@ static jv f_lgamma_r(jq_state *jq, jv input) {
+   jv_free(input);
+   return jv_array_append(ret, jv_number(sign));
+ }
++#else
++static jv f_lgamma_r(jq_state *jq, jv input) {
++  jv error = jv_string("Error: lgamma_r/0 not found at build time");
++  return ret_error(input, error);
++}
+ #endif
+ 
+ static jv f_negate(jq_state *jq, jv input) {
+@@ -1703,27 +1734,21 @@ static jv f_current_line(jq_state *jq, jv a) {
+ 
+ #define LIBM_DD(name) \
+   {f_ ## name,  #name, 1},
+-#define LIBM_DD_NO(name)
++#define LIBM_DD_NO(name) LIBM_DD(name)
+ 
+ #define LIBM_DDD(name) \
+   {f_ ## name, #name, 3},
+-#define LIBM_DDD_NO(name)
++#define LIBM_DDD_NO(name) LIBM_DDD(name)
+ 
+ #define LIBM_DDDD(name) \
+   {f_ ## name, #name, 4},
+-#define LIBM_DDDD_NO(name)
++#define LIBM_DDDD_NO(name) LIBM_DDDD(name)
+ 
+ static const struct cfunction function_list[] = {
+ #include "libm.h"
+-#ifdef HAVE_FREXP
+   {f_frexp,"frexp", 1},
+-#endif
+-#ifdef HAVE_MODF
+   {f_modf,"modf", 1},
+-#endif
+-#ifdef HAVE_LGAMMA_R
+   {f_lgamma_r,"lgamma_r", 1},
+-#endif
+   {f_negate, "_negate", 1},
+ #define BINOP(name) {f_ ## name, "_" #name, 3},
+ BINOPS
+@@ -1838,42 +1863,11 @@ static block bind_bytecoded_builtins(block b) {
+   return BLOCK(builtins, b);
+ }
+ 
+-static const char jq_builtins[] =
++static const char jq_builtins[] = {
+ /* Include jq-coded builtins */
+ #include "src/builtin.inc"
+-
+-/* Include unsupported math functions next */
+-#define LIBM_DD(name)
+-#define LIBM_DDD(name)
+-#define LIBM_DDDD(name)
+-#define LIBM_DD_NO(name) "def " #name ": \"Error: " #name "/0 not found at build time\"|error;"
+-#define LIBM_DDD_NO(name) "def " #name "(a;b): \"Error: " #name "/2 not found at build time\"|error;"
+-#define LIBM_DDDD_NO(name) "def " #name "(a;b;c): \"Error: " #name "/3 not found at build time\"|error;"
+-#include "libm.h"
+-#ifndef HAVE_FREXP
+-  "def frexp: \"Error: frexp/0 not found at build time\"|error;"
+-#endif
+-#ifndef HAVE_MODF
+-  "def modf: \"Error: modf/0 not found at build time\"|error;"
+-#endif
+-#ifndef HAVE_LGAMMA_R
+-  "def lgamma_r: \"Error: lgamma_r/0 not found at build time\"|error;"
+-#endif
+-;
+-
+-#undef LIBM_DDDD_NO
+-#undef LIBM_DDD_NO
+-#undef LIBM_DD_NO
+-#undef LIBM_DDDD
+-#undef LIBM_DDD
+-#undef LIBM_DD
+-
+-#ifdef __APPLE__
+-#undef HAVE_GAMMA
+-#undef HAVE_EXP10
+-#undef HAVE_DREM
+-#undef HAVE_SIGNIFICAND
+-#endif
++  '\0',
++};
+ 
+ static block gen_builtin_list(block builtins) {
+   jv list = jv_array_append(block_list_funcs(builtins, 1), jv_string("builtins/0"));
meta-oe/recipes-devtools/jq/jq/0002-libm.h-builtin.c-add-and-use-LIBM_DA-and-LIBM_DA_NO-.patch new file +164 -0

164 lines not on this page · raw message

meta-oe/recipes-devtools/jq/jq/0003-builtin.c-typecheck-builtin-cfunctions-in-function_l.patch new file +249 -0

249 lines not on this page · raw message

meta-oe/recipes-devtools/jq/jq_1.7.1.bb +3 -0
index dfc8dda7ee..5bc242d265 100644
@@ -10,6 +10,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=488f4e0b04c0456337fb70d1ac1758ba"
 
 GITHUB_BASE_URI = "https://github.com/jqlang/${BPN}/releases/"
 SRC_URI = "${GITHUB_BASE_URI}/download/${BPN}-${PV}/${BPN}-${PV}.tar.gz \
+    file://0001-builtin.c-fix-build-with-Woverlength-strings.patch \
+    file://0002-libm.h-builtin.c-add-and-use-LIBM_DA-and-LIBM_DA_NO-.patch \
+    file://0003-builtin.c-typecheck-builtin-cfunctions-in-function_l.patch \
     file://run-ptest \
     file://CVE-2024-23337.patch \
     file://CVE-2024-53427.patch \
Signature · 1 line
2.51.0
#2 lore raw

Re: [oe] [meta-oe][scarthgap][PATCH 2/2] jq: fix build with gcc-15

Hi,

Quoted 9 lines · Mikko Rapeli via lists.openembedded.org

From: Martin Jansa <[email protected]>

* backport 3 commits to fix:
http://errors.yoctoproject.org/Errors/Details/848831/

../jq-1.7.1/src/builtin.c:1705:4: error: initialization of 'jv (*)(void)' from incompatible pointer type 'jv (*)(jq_state *, jv)' [-Wincompatible-pointer-types]
1705 | {f_ ## name, #name, 1},

      |    ^~

This was applied was later reverted in master because it regresses tests. Can you please check?

Thanks,

Anuj

#3 lore raw

Re: [oe] [meta-oe][scarthgap][PATCH 2/2] jq: fix build with gcc-15

Hi,

Quoted 11 lines · Anuj Mittal

Hi,

Quoted 6 lines · Mikko Rapeli via lists.openembedded.org

From: Martin Jansa <[email protected]>

* backport 3 commits to fix:
http://errors.yoctoproject.org/Errors/Details/848831/

Quoted 6 lines
Quoted 3 lines

../jq-1.7.1/src/builtin.c:1705:4: error: initialization of 'jv (*)(void)' from incompatible pointer type 'jv (*)(jq_state *, jv)' [-Wincompatible-pointer-types]
1705 | {f_ ## name, #name, 1},

      |    ^~

This was applied was later reverted in master because it regresses tests. Can you please check?

Thanks, should have checked the git logs further. CFLAGS += "-std=gnu17" is better than the patch. Will fix in v3.

Cheers,

-Mikko

#4 lore raw
In reply to Mikko Rapeli

Hi,

Quoted 16 lines · Mikko Rapeli via lists.openembedded.org

With backport from upstream 6.9.10.

---
 ...08dee4a01dee60c4cd67f2e2e46484ef50a5.patch | 138 ++++++++++++++++++
 meta-oe/recipes-support/onig/onig_6.9.9.bb    |   1 +
 2 files changed, 139 insertions(+)
 create mode 100644 meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +0 -0
new file mode 100644
index 0000000000..f0683c2ebd

meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch line 5

Quoted 5 lines
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +5 -0
@@ -0,0 +1,138 @@
+From 5f1408dee4a01dee60c4cd67f2e2e46484ef50a5 Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <[email protected]>
+Date: Mon, 18 Nov 2024 00:18:12 +0900
+Subject: [PATCH] fix #312: Build failure with GCC 15 (C23)
+

This is missing Upstream-Status and Signed-off.

Quoted 157 lines
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +133 -0
+---
+ src/regparse.c | 44 ++++++++++++++++++++++++++++++++++++--------
+ src/st.h       |  9 +--------
+ 2 files changed, 37 insertions(+), 16 deletions(-)
+
+Upstream-Status: Backport [5f1408dee4a01dee60c4cd67f2e2e46484ef50a5]
+Signed-off-by: Mikko Rapeli <[email protected]>
+
+diff --git a/src/regparse.c b/src/regparse.c
+index 24bcbaac..9acdd6e2 100644
+--- a/src/regparse.c
++++ b/src/regparse.c
+@@ -793,8 +793,13 @@ onig_print_names(FILE* fp, regex_t* reg)
+ #endif /* ONIG_DEBUG */
+
+ static int
+-i_free_name_entry(UChar* key, NameEntry* e, void* arg ARG_UNUSED)
++i_free_name_entry(st_data_t akey, st_data_t ae, st_data_t arg ARG_UNUSED)
+ {
++  UChar* key;
++  NameEntry* e;
++
++  key = (UChar* )akey;
++  e = (NameEntry* )ae;
+   xfree(e->name);
+   if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs);
+   xfree(key);
+@@ -850,8 +855,14 @@ typedef struct {
+ } INamesArg;
+
+ static int
+-i_names(UChar* key ARG_UNUSED, NameEntry* e, INamesArg* arg)
++i_names(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t aarg)
+ {
++  NameEntry* e;
++  INamesArg* arg;
++
++  e = (NameEntry* )ae;
++  arg = (INamesArg* )aarg;
++
+   int r = (*(arg->func))(e->name,
+                          e->name + e->name_len,
+                          e->back_num,
+@@ -883,9 +894,14 @@ onig_foreach_name(regex_t* reg,
+ }
+
+ static int
+-i_renumber_name(UChar* key ARG_UNUSED, NameEntry* e, GroupNumMap* map)
++i_renumber_name(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t amap)
+ {
+   int i;
++  NameEntry* e;
++  GroupNumMap* map;
++
++  e = (NameEntry* )ae;
++  map = (GroupNumMap* )amap;
+
+   if (e->back_num > 1) {
+     for (i = 0; i < e->back_num; i++) {
+@@ -1374,9 +1390,14 @@ static int CalloutNameIDCounter;
+ #ifdef USE_ST_LIBRARY
+
+ static int
+-i_free_callout_name_entry(st_callout_name_key* key, CalloutNameEntry* e,
+-                          void* arg ARG_UNUSED)
++i_free_callout_name_entry(st_data_t akey, st_data_t ae, st_data_t arg ARG_UNUSED)
+ {
++  st_callout_name_key* key;
++  CalloutNameEntry* e;
++
++  key = (st_callout_name_key* )akey;
++  e = (CalloutNameEntry* )ae;
++
+   if (IS_NOT_NULL(e)) {
+     xfree(e->name);
+   }
+@@ -1870,10 +1891,14 @@ typedef intptr_t   CalloutTagVal;
+ #define CALLOUT_TAG_LIST_FLAG_TAG_EXIST     (1<<0)
+
+ static int
+-i_callout_callout_list_set(UChar* key, CalloutTagVal e, void* arg)
++i_callout_callout_list_set(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t arg)
+ {
+   int num;
+-  RegexExt* ext = (RegexExt* )arg;
++  CalloutTagVal e;
++  RegexExt* ext;
++
++  e   = (CalloutTagVal )ae;
++  ext = (RegexExt* )arg;
+
+   num = (int )e - 1;
+   ext->callout_list[num].flag |= CALLOUT_TAG_LIST_FLAG_TAG_EXIST;
+@@ -1926,8 +1951,11 @@ onig_callout_tag_is_exist_at_callout_num(regex_t* reg, int callout_num)
+ }
+
+ static int
+-i_free_callout_tag_entry(UChar* key, CalloutTagVal e, void* arg ARG_UNUSED)
++i_free_callout_tag_entry(st_data_t akey, st_data_t e ARG_UNUSED, st_data_t arg ARG_UNUSED)
+ {
++  UChar* key;
++
++  key = (UChar* )akey;
+   xfree(key);
+   return ST_DELETE;
+ }
+diff --git a/src/st.h b/src/st.h
+index 5efee8bb..70798dc5 100644
+--- a/src/st.h
++++ b/src/st.h
+@@ -34,13 +34,6 @@ enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
+ #ifndef _
+ # define _(args) args
+ #endif
+-#ifndef ANYARGS
+-# ifdef __cplusplus
+-#   define ANYARGS ...
+-# else
+-#   define ANYARGS
+-# endif
+-#endif
+
+ st_table *st_init_table _((struct st_hash_type *));
+ st_table *st_init_table_with_size _((struct st_hash_type *, int));
+@@ -52,7 +45,7 @@ int st_delete _((st_table *, st_data_t *, st_data_t *));
+ int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t));
+ int st_insert _((st_table *, st_data_t, st_data_t));
+ int st_lookup _((st_table *, st_data_t, st_data_t *));
+-int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
++int st_foreach _((st_table *, int (*)(st_data_t, st_data_t, st_data_t), st_data_t));
+ void st_add_direct _((st_table *, st_data_t, st_data_t));
+ void st_free_table _((st_table *));
+ void st_cleanup_safe _((st_table *, st_data_t));
meta-oe/recipes-support/onig/onig_6.9.9.bb +1 -1
index b29437db1e..b545fc7596 100644
@@ -11,6 +11,7 @@ SRC_URI = "\
     https://github.com/kkos/oniguruma/releases/download/v${PV}/${BP}.tar.gz \
     file://0001-build-don-t-link-against-host-system-libraries.patch \
     file://0002-build-enable-serial-tests-automake-option-for-ptest.patch \
+    file://5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch \
     file://run-ptest \
 "
 
--

2.51.0

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

#5 lore raw

Hi,

Quoted 15 lines · Anuj Mittal

Hi,

Quoted 10 lines · Mikko Rapeli via lists.openembedded.org

With backport from upstream 6.9.10.

---
 ...08dee4a01dee60c4cd67f2e2e46484ef50a5.patch | 138 ++++++++++++++++++
 meta-oe/recipes-support/onig/onig_6.9.9.bb    |   1 +
 2 files changed, 139 insertions(+)
 create mode 100644 meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch
Quoted 13 lines

meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch line 5

Quoted 11 lines
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +5 -0
new file mode 100644
index 0000000000..f0683c2ebd
@@ -0,0 +1,138 @@
+From 5f1408dee4a01dee60c4cd67f2e2e46484ef50a5 Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <[email protected]>
+Date: Mon, 18 Nov 2024 00:18:12 +0900
+Subject: [PATCH] fix #312: Build failure with GCC 15 (C23)
+

This is missing Upstream-Status and Signed-off.

They are...

Quoted 7 lines

meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch line 12

Quoted 7 lines
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +7 -0
+---
+ src/regparse.c | 44 ++++++++++++++++++++++++++++++++++++--------
+ src/st.h       |  9 +--------
+ 2 files changed, 37 insertions(+), 16 deletions(-)
+
+Upstream-Status: Backport [5f1408dee4a01dee60c4cd67f2e2e46484ef50a5]
+Signed-off-by: Mikko Rapeli <[email protected]>

... right here.

Cheers,

-Mikko

Quoted 149 lines
Quoted 149 lines
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +125 -0
+diff --git a/src/regparse.c b/src/regparse.c
+index 24bcbaac..9acdd6e2 100644
+--- a/src/regparse.c
++++ b/src/regparse.c
+@@ -793,8 +793,13 @@ onig_print_names(FILE* fp, regex_t* reg)
+ #endif /* ONIG_DEBUG */
+
+ static int
+-i_free_name_entry(UChar* key, NameEntry* e, void* arg ARG_UNUSED)
++i_free_name_entry(st_data_t akey, st_data_t ae, st_data_t arg ARG_UNUSED)
+ {
++  UChar* key;
++  NameEntry* e;
++
++  key = (UChar* )akey;
++  e = (NameEntry* )ae;
+   xfree(e->name);
+   if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs);
+   xfree(key);
+@@ -850,8 +855,14 @@ typedef struct {
+ } INamesArg;
+
+ static int
+-i_names(UChar* key ARG_UNUSED, NameEntry* e, INamesArg* arg)
++i_names(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t aarg)
+ {
++  NameEntry* e;
++  INamesArg* arg;
++
++  e = (NameEntry* )ae;
++  arg = (INamesArg* )aarg;
++
+   int r = (*(arg->func))(e->name,
+                          e->name + e->name_len,
+                          e->back_num,
+@@ -883,9 +894,14 @@ onig_foreach_name(regex_t* reg,
+ }
+
+ static int
+-i_renumber_name(UChar* key ARG_UNUSED, NameEntry* e, GroupNumMap* map)
++i_renumber_name(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t amap)
+ {
+   int i;
++  NameEntry* e;
++  GroupNumMap* map;
++
++  e = (NameEntry* )ae;
++  map = (GroupNumMap* )amap;
+
+   if (e->back_num > 1) {
+     for (i = 0; i < e->back_num; i++) {
+@@ -1374,9 +1390,14 @@ static int CalloutNameIDCounter;
+ #ifdef USE_ST_LIBRARY
+
+ static int
+-i_free_callout_name_entry(st_callout_name_key* key, CalloutNameEntry* e,
+-                          void* arg ARG_UNUSED)
++i_free_callout_name_entry(st_data_t akey, st_data_t ae, st_data_t arg ARG_UNUSED)
+ {
++  st_callout_name_key* key;
++  CalloutNameEntry* e;
++
++  key = (st_callout_name_key* )akey;
++  e = (CalloutNameEntry* )ae;
++
+   if (IS_NOT_NULL(e)) {
+     xfree(e->name);
+   }
+@@ -1870,10 +1891,14 @@ typedef intptr_t   CalloutTagVal;
+ #define CALLOUT_TAG_LIST_FLAG_TAG_EXIST     (1<<0)
+
+ static int
+-i_callout_callout_list_set(UChar* key, CalloutTagVal e, void* arg)
++i_callout_callout_list_set(st_data_t key ARG_UNUSED, st_data_t ae, st_data_t arg)
+ {
+   int num;
+-  RegexExt* ext = (RegexExt* )arg;
++  CalloutTagVal e;
++  RegexExt* ext;
++
++  e   = (CalloutTagVal )ae;
++  ext = (RegexExt* )arg;
+
+   num = (int )e - 1;
+   ext->callout_list[num].flag |= CALLOUT_TAG_LIST_FLAG_TAG_EXIST;
+@@ -1926,8 +1951,11 @@ onig_callout_tag_is_exist_at_callout_num(regex_t* reg, int callout_num)
+ }
+
+ static int
+-i_free_callout_tag_entry(UChar* key, CalloutTagVal e, void* arg ARG_UNUSED)
++i_free_callout_tag_entry(st_data_t akey, st_data_t e ARG_UNUSED, st_data_t arg ARG_UNUSED)
+ {
++  UChar* key;
++
++  key = (UChar* )akey;
+   xfree(key);
+   return ST_DELETE;
+ }
+diff --git a/src/st.h b/src/st.h
+index 5efee8bb..70798dc5 100644
+--- a/src/st.h
++++ b/src/st.h
+@@ -34,13 +34,6 @@ enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
+ #ifndef _
+ # define _(args) args
+ #endif
+-#ifndef ANYARGS
+-# ifdef __cplusplus
+-#   define ANYARGS ...
+-# else
+-#   define ANYARGS
+-# endif
+-#endif
+
+ st_table *st_init_table _((struct st_hash_type *));
+ st_table *st_init_table_with_size _((struct st_hash_type *, int));
+@@ -52,7 +45,7 @@ int st_delete _((st_table *, st_data_t *, st_data_t *));
+ int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t));
+ int st_insert _((st_table *, st_data_t, st_data_t));
+ int st_lookup _((st_table *, st_data_t, st_data_t *));
+-int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
++int st_foreach _((st_table *, int (*)(st_data_t, st_data_t, st_data_t), st_data_t));
+ void st_add_direct _((st_table *, st_data_t, st_data_t));
+ void st_free_table _((st_table *));
+ void st_cleanup_safe _((st_table *, st_data_t));
meta-oe/recipes-support/onig/onig_6.9.9.bb +1 -1
index b29437db1e..b545fc7596 100644
@@ -11,6 +11,7 @@ SRC_URI = "\
     https://github.com/kkos/oniguruma/releases/download/v${PV}/${BP}.tar.gz \
     file://0001-build-don-t-link-against-host-system-libraries.patch \
     file://0002-build-enable-serial-tests-automake-option-for-ptest.patch \
+    file://5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch \
     file://run-ptest \
 "
 
--

2.51.0

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

#6 lore raw
Quoted 35 lines · Mikko Rapeli

Hi,

Quoted 15 lines · Anuj Mittal

Hi,

Quoted 10 lines · Mikko Rapeli via lists.openembedded.org

With backport from upstream 6.9.10.

---
 ...08dee4a01dee60c4cd67f2e2e46484ef50a5.patch | 138 ++++++++++++++++++
 meta-oe/recipes-support/onig/onig_6.9.9.bb    |   1 +
 2 files changed, 139 insertions(+)
 create mode 100644 meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch
Quoted 13 lines

meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch line 5

Quoted 11 lines
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +5 -0
new file mode 100644
index 0000000000..f0683c2ebd
@@ -0,0 +1,138 @@
+From 5f1408dee4a01dee60c4cd67f2e2e46484ef50a5 Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <[email protected]>
+Date: Mon, 18 Nov 2024 00:18:12 +0900
+Subject: [PATCH] fix #312: Build failure with GCC 15 (C23)
+

This is missing Upstream-Status and Signed-off.

They are...

Quoted 10 lines
Quoted 7 lines

meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch line 12

Quoted 7 lines
meta-oe/recipes-support/onig/onig/5f1408dee4a01dee60c4cd67f2e2e46484ef50a5.patch new file +7 -0
+---
+ src/regparse.c | 44 ++++++++++++++++++++++++++++++++++++--------
+ src/st.h       |  9 +--------
+ 2 files changed, 37 insertions(+), 16 deletions(-)
+
+Upstream-Status: Backport [5f1408dee4a01dee60c4cd67f2e2e46484ef50a5]
+Signed-off-by: Mikko Rapeli <[email protected]>

... right here.

Thanks. So used to seeing it over the --- line and missed it.

Thanks,

Anuj