summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-01-25 23:21:05 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-27 08:20:02 +0000
commitbcbb15563503736e16b4cd850a53378adf1760f5 (patch)
treed3a57205b4883c13496da22137b2cba3208cf59e /meta/recipes-devtools/elfutils
parent4cb6ff8a57cb27bce31b76136fd32b1a54c01eaf (diff)
downloadpoky-bcbb15563503736e16b4cd850a53378adf1760f5.tar.gz
elfutils: Fix build with gcc trunk
Fixes a build issue seen with latest gcc trunk. Fixes | ../../elfutils-0.189/tests/elfstrmerge.c: In function 'main': | ../../elfutils-0.189/tests/elfstrmerge.c:450:32: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] | 450 | newscnbufs = calloc (sizeof (void *), newshnums); | | ^~~~ | ../../elfutils-0.189/tests/elfstrmerge.c:450:32: note: earlier argument should specify number of elements, later size of each element | cc1: all warnings being treated as errors (From OE-Core rev: 3817ac3130e8858b3445872ff74b39c21969822a) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/elfutils')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.189.bb1
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-tests-fix-build-against-upcoming-gcc-14-Werror-callo.patch39
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.189.bb b/meta/recipes-devtools/elfutils/elfutils_0.189.bb
index e9b432e4e9..076ba47358 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.189.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.189.bb
@@ -22,6 +22,7 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
22 file://ptest.patch \ 22 file://ptest.patch \
23 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \ 23 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \
24 file://0001-Add-helper-function-for-basename.patch \ 24 file://0001-Add-helper-function-for-basename.patch \
25 file://0001-tests-fix-build-against-upcoming-gcc-14-Werror-callo.patch \
25 " 26 "
26SRC_URI:append:libc-musl = " \ 27SRC_URI:append:libc-musl = " \
27 file://0003-musl-utils.patch \ 28 file://0003-musl-utils.patch \
diff --git a/meta/recipes-devtools/elfutils/files/0001-tests-fix-build-against-upcoming-gcc-14-Werror-callo.patch b/meta/recipes-devtools/elfutils/files/0001-tests-fix-build-against-upcoming-gcc-14-Werror-callo.patch
new file mode 100644
index 0000000000..5e0c7e9766
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0001-tests-fix-build-against-upcoming-gcc-14-Werror-callo.patch
@@ -0,0 +1,39 @@
1From 901c6a8c78c3c4eee244b9d5298cbd7b9aa713d1 Mon Sep 17 00:00:00 2001
2From: Sergei Trofimovich <slyich@gmail.com>
3Date: Thu, 21 Dec 2023 09:23:30 +0000
4Subject: [PATCH] tests: fix build against upcoming `gcc-14`
5 (`-Werror=calloc-transposed-args`)
6
7`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
8detected minor infelicity in `calloc()` API usage in `elfutils`:
9
10 elfstrmerge.c: In function 'main':
11 elfstrmerge.c:450:32: error:
12 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
13 450 | newscnbufs = calloc (sizeof (void *), newshnums);
14 | ^~~~
15 elfstrmerge.c:450:32: note: earlier argument should specify number of elements, later size of each element
16
17Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=ae580d48278b9924da7503886b37be34378e1b04]
18Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20---
21 tests/elfstrmerge.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
25index 56350bb..4eb58bb 100644
26--- a/tests/elfstrmerge.c
27+++ b/tests/elfstrmerge.c
28@@ -447,7 +447,7 @@ main (int argc, char **argv)
29 }
30
31 newshnums = shdrnum - 1;
32- newscnbufs = calloc (sizeof (void *), newshnums);
33+ newscnbufs = calloc (newshnums, sizeof (void *));
34 if (newscnbufs == NULL)
35 fail_errno ("Couldn't allocate memory for new section buffers", NULL);
36
37--
382.43.0
39