From a72c24e7e5670b4533c4508d6d6c980d8487cb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnegren?= Date: Sat, 7 Dec 2024 15:35:13 +0100 Subject: [PATCH] meson: Add scx_lib dep to gen_bpf_o MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces a dependency on scx_lib in gen_bpf_o. Without this dependency the build fails intermittently with the following error: ``` FAILED: scheds/c/scx_pair.p/scx_pair.bpf.skel.h scheds/c/scx_pair.p/scx_pair.bpf.subskel.h /home/frelon/src/scx/meson-scripts/bpftool_build_skel /usr/sbin/bpftool scheds/c/scx_pair.p/scx_pair.bpf.o scheds/c/scx_pair.p/scx_pair.bpf.skel.h scheds/c/scx_pair.p/scx_pair.bpf.subskel.h /home/frelon/src/scx/build/lib/lib libbpf: failed to get ELF header for /home/frelon/src/scx/build/lib/lib.bpf.o: invalid `Elf' handle /home/frelon/src/scx/meson-scripts/bpftool_build_skel: line 25: 3400506 Segmentation fault (core dumped) "$bpftool" gen object "$stem".l1o "$input" "$lib".bpf.o ``` Signed-off-by: Fredrik Lönnegren --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 21b808b3b..c22f6a4a7 100644 --- a/meson.build +++ b/meson.build @@ -270,12 +270,15 @@ bpf_includes = ['-I', join_paths(meson.current_source_dir(), 'scheds/include'), '-I', join_paths(meson.current_source_dir(), 'scheds/include/bpf-compat'), '-I', join_paths(meson.current_source_dir(), 'lib/include'),] +lib_objs = [] +subdir('lib') + # # Generators to build BPF skel file for C schedulers. # gen_bpf_o = generator(bpf_clang, output: '@BASENAME@.o', - depends: [libbpf], + depends: [libbpf, scx_lib], arguments: [bpf_base_cflags, '-target', 'bpf', libbpf_c_headers, bpf_includes, '-c', '@INPUT@', '-o', '@OUTPUT@']) @@ -459,9 +462,6 @@ if enable_stress endif endif -lib_objs = [] -subdir('lib') - thread_dep = dependency('threads') subdir('scheds')