From 2bad1dd58e4900c25c59d2a8d1e759444eaf32a1 Mon Sep 17 00:00:00 2001 From: Piotr Gorski Date: Mon, 20 May 2024 09:24:49 +0200 Subject: [PATCH] meson: fix a build error for libbpf at release build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix error: INFO: autodetecting backend as ninja INFO: calculating backend command to run: /usr/bin/ninja -C /home/lucjan/Pobrane/scx-scheds-git/src/scx/build ninja: Entering directory `/home/lucjan/Pobrane/scx-scheds-git/src/scx/build' [2/31] Generating bpftool_target with a custom command FAILED: bpftool_dummy.c.__PHONY__ /bin/bash /home/lucjan/Pobrane/scx-scheds-git/src/scx/meson-scripts/build_bpftool /usr/bin/jq /usr/bin/make /home/lucjan/Pobrane/scx-scheds-git/src/scx/build/bpftool/src 4 libbpf.c: In function ‘bpf_object__gen_loader’: libbpf.c: In function ‘bpf_object__gen_loader’: libbpf.c:8994:28: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 8994 | gen = calloc(sizeof(*gen), 1); | ^ libbpf.c:8994:28: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 8994 | gen = calloc(sizeof(*gen), 1); | ^ libbpf.c:8994:28: note: earlier argument should specify number of elements, later size of each element libbpf.c:8994:28: note: earlier argument should specify number of elements, later size of each element At top level: cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics cc1: all warnings being treated as errors make[1]: *** [Makefile:134: /home/lucjan/Pobrane/scx-scheds-git/src/scx/build/bpftool/src/bootstrap/libbpf/staticobjs/libbpf.o] Error 1 make: *** [Makefile:52: /home/lucjan/Pobrane/scx-scheds-git/src/scx/build/bpftool/src/bootstrap/libbpf/libbpf.a] Error 2 make: *** Waiting for unfinished jobs.... At top level: cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics cc1: all warnings being treated as errors make[1]: *** [Makefile:134: /home/lucjan/Pobrane/scx-scheds-git/src/scx/build/bpftool/src/libbpf/staticobjs/libbpf.o] Error 1 make: *** [Makefile:44: /home/lucjan/Pobrane/scx-scheds-git/src/scx/build/bpftool/src/libbpf/libbpf.a] Error 2 ninja: build stopped: subcommand failed. Signed-off-by: Piotr Gorski --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 8583244a1..1d033b9a6 100644 --- a/meson.build +++ b/meson.build @@ -61,7 +61,7 @@ endif # These are for building libbpf and/or bpftool if meson.get_compiler('c').get_id() == 'gcc' - extra_args = ['-Wno-sign-compare', '-Wno-maybe-uninitialized'] + extra_args = ['-Wno-sign-compare', '-Wno-maybe-uninitialized', '-Wno-calloc-transposed-args'] else extra_args = [] endif