]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: set minimum clang/llvm versions for bpf support
authorJames Hilliard <james.hilliard1@gmail.com>
Mon, 31 Jan 2022 02:33:55 +0000 (19:33 -0700)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Jan 2022 05:27:11 +0000 (14:27 +0900)
The minimum clang/llvm-strip version needed for building libbpf based
programs is 10.0.0, this is documented here:
https://github.com/libbpf/libbpf/tree/v0.6.1#bpf-co-re-compile-once--run-everywhere

Using an older version such as 9.0.0 will generate objects that
bpftool will not be able to generate skeletons for.

meson.build

index 9faa6583a077be448bd9dadc253b2be4814ce116..43c3252e3611817967383768121926727c78467a 100644 (file)
@@ -988,7 +988,7 @@ else
         # Support 'versioned' clang/llvm-strip binaries, as seen on Debian/Ubuntu
         # (like clang-10/llvm-strip-10)
         if meson.is_cross_build() or cc.get_id() != 'clang' or cc.cmd_array()[0].contains('afl-clang') or cc.cmd_array()[0].contains('hfuzz-clang')
-                r = find_program('clang', required : bpf_framework_required)
+                r = find_program('clang', required : bpf_framework_required, version : '>= 10.0.0')
                 clang_found = r.found()
                 if clang_found
                         if meson.version().version_compare('>= 0.55')
@@ -1018,7 +1018,7 @@ else
         else
                 llvm_strip_bin = 'llvm-strip'
         endif
-        llvm_strip = find_program(llvm_strip_bin, required : bpf_framework_required)
+        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.
         # We check for 'bpftool' first, honouring $PATH, and in /usr/sbin/ for Debian.