From 6108ab163ef8fe3da1051b5646138468d091f47e Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 2 Dec 2021 21:49:02 +0100 Subject: [PATCH 1/3] meson: support versioned llvm binaries in BPF detection --- meson.build | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 0eb89a7bbd..1230e7ff33 100644 --- a/meson.build +++ b/meson.build @@ -992,8 +992,17 @@ conf.set10('HAVE_LIBBPF', libbpf.found()) if want_bpf_framework == 'false' conf.set10('BPF_FRAMEWORK', 0) else - clang = find_program('clang', required : bpf_framework_required) - llvm_strip = find_program('llvm-strip', required : bpf_framework_required) + # Support 'versioned' clang/llvm-strip binaries, as seen on Debian/Ubuntu + # (like clang-10/llvm-strip-10) + clang_bin = cc.get_id() == 'clang' ? cc.cmd_array()[0] : 'clang' + clang = find_program(clang_bin, required : bpf_framework_required) + if clang.found() + llvm_strip_bin = run_command(clang, '--print-prog-name', 'llvm-strip', + check : true).stdout().strip() + else + llvm_strip_bin = 'llvm-strip' + endif + llvm_strip = find_program(llvm_strip_bin, required : bpf_framework_required) # Debian installs this in /usr/sbin/ which is not in $PATH. # We check for 'bpftool' first, honouring $PATH, and in /usr/sbin/ for Debian. From 466e63a453da9132e84ec9777de3eae4e840a15c Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 3 Dec 2021 07:37:32 +0100 Subject: [PATCH 2/3] analyze: fix build with -Db_ndebug=true --- src/analyze/analyze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index a641be4179..d5057bbe85 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -1959,7 +1959,7 @@ static int dump_filesystems(int argc, char *argv[], void *userdata) { const statfs_f_type_t *magic; bool is_primary = false; - assert(fs_type_from_string(*filesystem, &magic) >= 0); + assert_se(fs_type_from_string(*filesystem, &magic) >= 0); for (size_t i = 0; magic[i] != 0; i++) { const char *primary; From 9371d44afec0feae2c1bbbb0c894f76ab474858e Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 3 Dec 2021 16:30:56 +0100 Subject: [PATCH 3/3] ci: install libbpf --- .github/workflows/build_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_test.sh b/.github/workflows/build_test.sh index 9f4ef79bbb..abf7c3a8a7 100755 --- a/.github/workflows/build_test.sh +++ b/.github/workflows/build_test.sh @@ -27,6 +27,7 @@ PACKAGES=( itstool kbd libblkid-dev + libbpf-dev libcap-dev libcurl4-gnutls-dev libfdisk-dev @@ -48,8 +49,8 @@ PACKAGES=( net-tools perl python3-evdev - python3-lxml python3-jinja2 + python3-lxml python3-pip python3-pyparsing python3-setuptools