From c022f3ec33cb019aa6ac56d84c8cc4713f1ac645 Mon Sep 17 00:00:00 2001 From: "mark.yang" Date: Wed, 2 Apr 2025 15:38:17 +0900 Subject: unbound: fix build with gcc-15.0.1 * fix following error: http://errors.yoctoproject.org/Errors/Details/850313/ ../git/compat/malloc.c:9:7: warning: conflicting types for built-in function 'malloc'; expected 'void *(long unsigned int)' [-Wbuiltin-declaration-mismatch] 9 | void *malloc (); | ^~~~~~ ../git/compat/malloc.c:5:1: note: 'malloc' is declared in header '' 4 | #include "config.h" +++ |+#include 5 | #undef malloc ../git/compat/malloc.c: In function 'rpl_malloc_unbound': ../git/compat/malloc.c:23:10: error: too many arguments to function 'malloc'; expected 0, have 1 23 | return malloc (n); | ^~~~~~ ~ ../git/compat/malloc.c:9:7: note: declared here 9 | void *malloc (); | ^~~~~~ * Seeing that there is '#undef malloc', it appears they don't want to use the malloc from stdlib.h. Therefore, we need to correctly define the parameters for malloc. Signed-off-by: mark.yang Signed-off-by: Khem Raj --- ...ith-gcc-15-Wbuiltin-declaration-mismatch-.patch | 44 ++++++++++++++++++++++ .../recipes-support/unbound/unbound_1.22.0.bb | 1 + 2 files changed, 45 insertions(+) create mode 100644 meta-networking/recipes-support/unbound/unbound/0001-fix-build-with-gcc-15-Wbuiltin-declaration-mismatch-.patch (limited to 'meta-networking') diff --git a/meta-networking/recipes-support/unbound/unbound/0001-fix-build-with-gcc-15-Wbuiltin-declaration-mismatch-.patch b/meta-networking/recipes-support/unbound/unbound/0001-fix-build-with-gcc-15-Wbuiltin-declaration-mismatch-.patch new file mode 100644 index 0000000000..70a41f7e37 --- /dev/null +++ b/meta-networking/recipes-support/unbound/unbound/0001-fix-build-with-gcc-15-Wbuiltin-declaration-mismatch-.patch @@ -0,0 +1,44 @@ +From 1c58ce07919c36e6a11eead67bd6d14cc22acaec Mon Sep 17 00:00:00 2001 +From: "mark.yang" +Date: Wed, 2 Apr 2025 15:25:42 +0900 +Subject: [PATCH] fix build with gcc-15 -Wbuiltin-declaration-mismatch error + +See more details: http://errors.yoctoproject.org/Errors/Details/850313 +../git/compat/malloc.c:9:7: warning: conflicting types for built-in function 'malloc'; expected 'void *(long unsigned int)' [-Wbuiltin-declaration-mismatch] + 9 | void *malloc (); + | ^~~~~~ +../git/compat/malloc.c:5:1: note: 'malloc' is declared in header '' + 4 | #include "config.h" + +++ |+#include + 5 | #undef malloc +../git/compat/malloc.c: In function 'rpl_malloc_unbound': +../git/compat/malloc.c:23:10: error: too many arguments to function 'malloc'; expected 0, have 1 + 23 | return malloc (n); + | ^~~~~~ ~ +../git/compat/malloc.c:9:7: note: declared here + 9 | void *malloc (); + | ^~~~~~ + +* Seeing that there is '#undef malloc', it appears they don't want to + use the malloc from stdlib.h. + Therefore, we need to correctly define the parameters for malloc. + +Upstream-Status: Submitted [https://github.com/NLnetLabs/unbound/pull/1262] +Signed-off-by: mark.yang +--- + compat/malloc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/compat/malloc.c b/compat/malloc.c +index d8097b13e..af9dcf134 100644 +--- a/compat/malloc.c ++++ b/compat/malloc.c +@@ -6,7 +6,7 @@ + #include + + #ifndef USE_WINSOCK +-void *malloc (); ++void *malloc (size_t n); + #else + /* provide a prototype */ + void *malloc (size_t n); diff --git a/meta-networking/recipes-support/unbound/unbound_1.22.0.bb b/meta-networking/recipes-support/unbound/unbound_1.22.0.bb index 2f0c92dd9f..c434ca181f 100644 --- a/meta-networking/recipes-support/unbound/unbound_1.22.0.bb +++ b/meta-networking/recipes-support/unbound/unbound_1.22.0.bb @@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06" SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;branch=master \ file://run-ptest \ + file://0001-fix-build-with-gcc-15-Wbuiltin-declaration-mismatch-.patch \ " # 17 commits after 1.22.0 tag: -- cgit v1.2.3-54-g00ecf