diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2024-07-20 13:38:37 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-07-20 15:59:34 +0200 |
commit | 8da20e3fe2a544979922cea457de3031aa74d64c (patch) | |
tree | 1eee3a10a0834ea9bc8266b45407f3b1b19d7d39 | |
parent | upate TODO (diff) | |
download | systemd-8da20e3fe2a544979922cea457de3031aa74d64c.tar.xz systemd-8da20e3fe2a544979922cea457de3031aa74d64c.zip |
meson: fix missing failure if bpf-framework was enabled
If building with clang and clang does not support bpf, then enabling
-Dbpf-framework=enabled would silently drop the feature (even printing
bpf-framework: enabled in the meson build recap, and no message anywhere
that'd hint at the failure!)
This is unexpected, so add check to fail hard in this case.
All other code paths (gcc, missing bpftool) properly check for the
option, but it is not as easy for a custom command so check explicitly
-rw-r--r-- | meson.build | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 3893a9fabe..e0bbb6a908 100644 --- a/meson.build +++ b/meson.build @@ -1102,6 +1102,9 @@ else # Check if 'clang -target bpf' is supported. clang_supports_bpf = run_command(clang, '-target', 'bpf', '--print-supported-cpus', check : false).returncode() == 0 endif + if bpf_framework.enabled() and not clang_supports_bpf + error('bpf-framework was enabled but clang does not support bpf') + endif elif bpf_compiler == 'gcc' bpf_gcc = find_program('bpf-gcc', 'bpf-none-gcc', |