-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1158 from etsal/etsal/meson-no-default-lib
meson: do not link BPF library into C schedulers by default
- Loading branch information
Showing
4 changed files
with
54 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
bpftool="$1" | ||
input="$2" | ||
skel="$3" | ||
subskel="$4" | ||
lib="$5" | ||
|
||
stem="${input%.o}" | ||
name="${input%.bpf.o}" | ||
name="${name##*/}" | ||
|
||
if [ -z "$lib" ] || [ `basename $lib` == $name ]; | ||
then | ||
"$bpftool" gen object "$stem".l1o "$input" | ||
else | ||
"$bpftool" gen object "$stem".l1o "$input" "$lib".bpf.o | ||
"$bpftool" gen object "$stem".l2o "$stem".l1o | ||
"$bpftool" gen object "$stem".l3o "$stem".l2o | ||
cmp "$stem".l2o "$stem".l3o | ||
"$bpftool" gen skeleton "$stem".l3o name "$name" > "$skel" | ||
"$bpftool" gen subskeleton "$stem".l3o name "$name" > "$subskel" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,8 @@ get_bpftool_ver = find_program(join_paths(meson.current_source_dir(), | |
'meson-scripts/get_bpftool_ver')) | ||
bpftool_build_skel = find_program(join_paths(meson.current_source_dir(), | ||
'meson-scripts/bpftool_build_skel')) | ||
bpftool_build_skel_lib = find_program(join_paths(meson.current_source_dir(), | ||
'meson-scripts/bpftool_build_skel_lib')) | ||
get_sys_incls = find_program(join_paths(meson.current_source_dir(), | ||
'meson-scripts/get_sys_incls')) | ||
test_sched = find_program(join_paths(meson.current_source_dir(), | ||
|
@@ -278,15 +280,19 @@ subdir('lib') | |
# | ||
gen_bpf_o = generator(bpf_clang, | ||
output: '@[email protected]', | ||
depends: [libbpf, scx_lib], | ||
depends: [libbpf], | ||
arguments: [bpf_base_cflags, '-target', 'bpf', libbpf_c_headers, bpf_includes, | ||
'-c', '@INPUT@', '-o', '@OUTPUT@']) | ||
|
||
gen_bpf_skel = generator(bpftool_build_skel, | ||
output: ['@[email protected]','@[email protected]' ], | ||
depends: [libbpf, bpftool_target], | ||
arguments: [bpftool_exe_path, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@', scx_lib_path]) | ||
arguments: [bpftool_exe_path, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@']) | ||
|
||
gen_bpf_skel_lib = generator(bpftool_build_skel_lib, | ||
output: ['@[email protected]','@[email protected]' ], | ||
depends: [libbpf, bpftool_target, scx_lib], | ||
arguments: [bpftool_exe_path, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@', scx_lib_path]) | ||
|
||
# | ||
# For rust sub-projects. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters