mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
meson: use bpftool based strip when available
This should be useable in bpftool v5.13 or newer based on:
d80b2fcbe0
This commit is contained in:
parent
408832e603
commit
e3759ac43a
34
meson.build
34
meson.build
@ -1012,23 +1012,35 @@ else
|
|||||||
clang_supports_bpf = false
|
clang_supports_bpf = false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if not meson.is_cross_build() and 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, version : '>= 10.0.0')
|
|
||||||
|
|
||||||
# Debian installs this in /usr/sbin/ which is not in $PATH.
|
# Debian installs this in /usr/sbin/ which is not in $PATH.
|
||||||
# We check for 'bpftool' first, honouring $PATH, and in /usr/sbin/ for Debian.
|
# We check for 'bpftool' first, honouring $PATH, and in /usr/sbin/ for Debian.
|
||||||
# We use 'bpftool gen' subcommand, it was added by 985ead416df39d6fe8e89580cc1db6aa273e0175 (v5.6).
|
# We use 'bpftool gen' subcommand, it was added by 985ead416df39d6fe8e89580cc1db6aa273e0175 (v5.6).
|
||||||
bpftool = find_program('bpftool',
|
bpftool = find_program('bpftool',
|
||||||
'/usr/sbin/bpftool',
|
'/usr/sbin/bpftool',
|
||||||
required : bpf_framework_required,
|
required : false,
|
||||||
version : '>= 5.6')
|
version : '>= 5.13.0')
|
||||||
|
|
||||||
deps_found = clang_found and clang_supports_bpf and clang_supports_flags and llvm_strip.found() and bpftool.found()
|
if bpftool.found()
|
||||||
|
bpftool_strip = true
|
||||||
|
else
|
||||||
|
bpftool_strip = false
|
||||||
|
bpftool = find_program('bpftool',
|
||||||
|
'/usr/sbin/bpftool',
|
||||||
|
required : bpf_framework_required,
|
||||||
|
version : '>= 5.6.0')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if not bpftool_strip
|
||||||
|
if not meson.is_cross_build() and 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, version : '>= 10.0.0')
|
||||||
|
endif
|
||||||
|
|
||||||
|
deps_found = clang_found and clang_supports_bpf and clang_supports_flags and (bpftool_strip or llvm_strip.found()) and bpftool.found()
|
||||||
|
|
||||||
# Can build BPF program from source code in restricted C
|
# Can build BPF program from source code in restricted C
|
||||||
conf.set10('BPF_FRAMEWORK', deps_found)
|
conf.set10('BPF_FRAMEWORK', deps_found)
|
||||||
|
@ -65,13 +65,23 @@ bpf_o_unstripped_cmd += [
|
|||||||
'@OUTPUT@'
|
'@OUTPUT@'
|
||||||
]
|
]
|
||||||
|
|
||||||
bpf_o_cmd = [
|
if bpftool_strip
|
||||||
llvm_strip,
|
bpf_o_cmd = [
|
||||||
'-g',
|
bpftool,
|
||||||
'@INPUT@',
|
'g',
|
||||||
'-o',
|
'o',
|
||||||
'@OUTPUT@'
|
'@OUTPUT@',
|
||||||
]
|
'@INPUT@'
|
||||||
|
]
|
||||||
|
else
|
||||||
|
bpf_o_cmd = [
|
||||||
|
llvm_strip,
|
||||||
|
'-g',
|
||||||
|
'@INPUT@',
|
||||||
|
'-o',
|
||||||
|
'@OUTPUT@'
|
||||||
|
]
|
||||||
|
endif
|
||||||
|
|
||||||
skel_h_cmd = [
|
skel_h_cmd = [
|
||||||
bpftool,
|
bpftool,
|
||||||
|
Loading…
Reference in New Issue
Block a user