diff options
Diffstat (limited to 'meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch')
-rw-r--r-- | meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch b/meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch new file mode 100644 index 0000000000..e3d94d9312 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From d42139cf9cd26d0c0363fcfe007716baeb8de517 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sergei Trofimovich <slyich@gmail.com> | ||
3 | Date: Fri, 22 Dec 2023 19:42:38 +0000 | ||
4 | Subject: [PATCH] bpf-translate.cxx: fix build against upcoming `gcc-14` | ||
5 | (`-Werror=calloc-transposed-args`) | ||
6 | |||
7 | `gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It | ||
8 | detected minor infelicity in `calloc()` API usage in `systemtap`: | ||
9 | |||
10 | bpf-translate.cxx: In function 'bpf::BPF_Section* bpf::output_probe(BPF_Output&, program&, const std::string&, unsigned int)': | ||
11 | bpf-translate.cxx:5044:39: error: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] | ||
12 | 5044 | bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns); | ||
13 | | ^~~~~~~~~~~~~~~~ | ||
14 | bpf-translate.cxx:5044:39: note: earlier argument should specify number of elements, later size of each element | ||
15 | |||
16 | Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=d42139cf9cd26d0c0363fcfe007716baeb8de517] | ||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | bpf-translate.cxx | 4 ++-- | ||
20 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
21 | |||
22 | diff --git a/bpf-translate.cxx b/bpf-translate.cxx | ||
23 | index 1a9302463..aa8ef65ce 100644 | ||
24 | --- a/bpf-translate.cxx | ||
25 | +++ b/bpf-translate.cxx | ||
26 | @@ -5041,9 +5041,9 @@ output_probe(BPF_Output &eo, program &prog, | ||
27 | } | ||
28 | } | ||
29 | |||
30 | - bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns); | ||
31 | + bpf_insn *buf = (bpf_insn*) calloc (ninsns, sizeof(bpf_insn)); | ||
32 | assert (buf); | ||
33 | - Elf64_Rel *rel = (Elf64_Rel*) calloc (sizeof(Elf64_Rel), nreloc); | ||
34 | + Elf64_Rel *rel = (Elf64_Rel*) calloc (nreloc, sizeof(Elf64_Rel)); | ||
35 | assert (rel); | ||
36 | |||
37 | unsigned i = 0, r = 0; | ||
38 | -- | ||
39 | 2.43.0 | ||
40 | |||