jq: fix build with gcc-15.0.1
PATCH 1/1 jq: fix build with gcc-15.0.1
From: "mark.yang" <[email protected]>
* to fix: http://errors.yoctoproject.org/Errors/Details/848776/
* If upgrade the version of jq, the build will succeed when
https://github.com/jqlang/jq/commit/0b82b3841b05faefe0ac18379bdb361b7e4e3464 is included.
I'd like to backport it, but It have to backport a lot of patches.
--- .../0001-Fix-gcc-15.0.1-compile-error.patch | 46 +++++++++++++++++++ meta-oe/recipes-devtools/jq/jq_1.7.1.bb | 1 + 2 files changed, 47 insertions(+) create mode 100644 meta-oe/recipes-devtools/jq/jq/0001-Fix-gcc-15.0.1-compile-error.patch
meta-oe/recipes-devtools/jq/jq/0001-Fix-gcc-15.0.1-compile-error.patch new file +46 -0
@@ -0,0 +1,46 @@ +From d40319093e517aedc6de610215bf571698a5e60b Mon Sep 17 00:00:00 2001 +From: "mark.yang" <[email protected]> +Date: Tue, 25 Mar 2025 15:20:15 +0900 +Subject: [PATCH] Fix gcc-15.0.1 compile error + +* to fix: http://errors.yoctoproject.org/Errors/Details/848776/ +../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}, + +The function pointer in bytecode.h is ambiguously defined. + struct cfunction { + jv (*fptr)(); // function pointer with no parameters + const char* name; + int nargs; + }; +I think that previous versions of GCC allowed casting between function pointers with +no parameters and function pointers with parameters, +but GCC 15.0.1 treats this as an error. +Changed to void *fptr to make the function pointer not bound to a specific signature. + +* If upgrade the version of jq, the build will succeed when + https://github.com/jqlang/jq/commit/0b82b3841b05faefe0ac18379bdb361b7e4e3464 is included. + +I'd like to backport it, but It have to backport a lot of patches. + +Signed-off-by: mark.yang <[email protected]> + +Upstream-Status: Inappropriate [oe specific] +--- + src/bytecode.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bytecode.h b/src/bytecode.h +index 1501985..c8ab39a 100644 +--- a/src/bytecode.h ++++ b/src/bytecode.h +@@ -46,7 +46,7 @@ const struct opcode_description* opcode_describe(opcode op); + + #define MAX_CFUNCTION_ARGS 10 + struct cfunction { +- jv (*fptr)(); ++ void *fptr; + const char* name; + int nargs; + }; +
meta-oe/recipes-devtools/jq/jq_1.7.1.bb +1 -0
@@ -11,6 +11,7 @@ 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://run-ptest \ + file://0001-Fix-gcc-15.0.1-compile-error.patch \ " SRC_URI[sha256sum] = "478c9ca129fd2e3443fe27314b455e211e0d8c60bc8ff7df703873deeee580c2"
Signature · 1 line
2.34.1
seems it is already part of Martin's patch
Quoted 93 lines · mark.yang via lists.openembedded.org
From: "mark.yang" <[email protected]>
* to fix: http://errors.yoctoproject.org/Errors/Details/848776/
* If upgrade the version of jq, the build will succeed when
https://github.com/jqlang/jq/commit/0b82b3841b05faefe0ac18379bdb361b7e4e3464 is included.I'd like to backport it, but It have to backport a lot of patches.
Signed-off-by mark.yang <[email protected]>--- .../0001-Fix-gcc-15.0.1-compile-error.patch | 46 +++++++++++++++++++ meta-oe/recipes-devtools/jq/jq_1.7.1.bb | 1 + 2 files changed, 47 insertions(+) create mode 100644 meta-oe/recipes-devtools/jq/jq/0001-Fix-gcc-15.0.1-compile-error.patchmeta-oe/recipes-devtools/jq/jq/0001-Fix-gcc-15.0.1-compile-error.patch new file +46
-0@@ -0,0 +1,46 @@ +From d40319093e517aedc6de610215bf571698a5e60b Mon Sep 17 00:00:00 2001 +From: "mark.yang" <[email protected]> +Date: Tue, 25 Mar 2025 15:20:15 +0900 +Subject: [PATCH] Fix gcc-15.0.1 compile error + +* to fix: http://errors.yoctoproject.org/Errors/Details/848776/ +../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}, + +The function pointer in bytecode.h is ambiguously defined. + struct cfunction { + jv (*fptr)(); // function pointer with no parameters + const char* name; + int nargs; + }; +I think that previous versions of GCC allowed casting between function pointers with +no parameters and function pointers with parameters, +but GCC 15.0.1 treats this as an error. +Changed to void *fptr to make the function pointer not bound to a specific signature. + +* If upgrade the version of jq, the build will succeed when + https://github.com/jqlang/jq/commit/0b82b3841b05faefe0ac18379bdb361b7e4e3464 is included. + +I'd like to backport it, but It have to backport a lot of patches. + +Signed-off-by: mark.yang <[email protected]> + +Upstream-Status: Inappropriate [oe specific] +--- + src/bytecode.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bytecode.h b/src/bytecode.h +index 1501985..c8ab39a 100644 +--- a/src/bytecode.h ++++ b/src/bytecode.h +@@ -46,7 +46,7 @@ const struct opcode_description* opcode_describe(opcode op); + + #define MAX_CFUNCTION_ARGS 10 + struct cfunction { +- jv (*fptr)(); ++ void *fptr; + const char* name; + int nargs; + }; +meta-oe/recipes-devtools/jq/jq_1.7.1.bb +1
-1@@ -11,6 +11,7 @@ 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://run-ptest \ + file://0001-Fix-gcc-15.0.1-compile-error.patch \ " SRC_URI[sha256sum] = "478c9ca129fd2e3443fe27314b455e211e0d8c60bc8ff7df703873deeee580c2" --2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#116277): https://lists.openembedded.org/g/openembedded-devel/message/116277
Mute This Topic: https://lists.openembedded.org/mt/111897169/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-