build: drop "ebpf" configuration for n-acd compilation

Since we now check whether the user's machine supports
eBPF at runtime, we can drop all of this build machinery.
This commit is contained in:
Jan Vaclav 2025-10-16 11:58:57 +02:00
parent 191ebb439a
commit 8d33aaa5b6
7 changed files with 3 additions and 42 deletions

View file

@ -155,12 +155,7 @@ test_subtree() {
do_clean do_clean
pushd ./src/$d pushd ./src/$d
ARGS=() CC="$cc" CFLAGS="-Werror -Wall" meson build
if [ "$d" = n-acd ]; then
ARGS+=('-Debpf=false')
fi
CC="$cc" CFLAGS="-Werror -Wall" meson build "${ARGS[@]}"
ninja -v -C build test ninja -v -C build test
popd popd

View file

@ -154,17 +154,6 @@
%bcond_with ifcfg_migrate %bcond_with ifcfg_migrate
%endif %endif
%if 0%{?fedora}
# Although eBPF would be available on Fedora's kernel, it seems
# we often get SELinux denials (rh#1651654). But even aside them,
# bpf(BPF_MAP_CREATE, ...) randomly fails with EPERM. That might
# be related to `ulimit -l`. Anyway, this is not usable at the
# moment.
%global ebpf_enabled "no"
%else
%global ebpf_enabled "no"
%endif
# Fedora 33 enables LTO by default by setting CFLAGS="-flto -ffat-lto-objects". # Fedora 33 enables LTO by default by setting CFLAGS="-flto -ffat-lto-objects".
# However, we also require "-flto -flto-partition=none", so disable Fedora's # However, we also require "-flto -flto-partition=none", so disable Fedora's
# default and use our configure option --with-lto instead. # default and use our configure option --with-lto instead.
@ -682,11 +671,6 @@ Preferably use nmcli instead.
-Dlibpsl=true \ -Dlibpsl=true \
%else %else
-Dlibpsl=false \ -Dlibpsl=false \
%endif
%if %{ebpf_enabled} != "yes"
-Debpf=false \
%else
-Debpf=true \
%endif %endif
-Dsession_tracking=systemd \ -Dsession_tracking=systemd \
-Dsuspend_resume=systemd \ -Dsuspend_resume=systemd \

View file

@ -155,7 +155,6 @@ P_CRYPTO="${CRYPTO-}"
P_DBUS_SYS_DIR="${DBUS_SYS_DIR-}" P_DBUS_SYS_DIR="${DBUS_SYS_DIR-}"
P_DHCP_DEFAULT="${DHCP_DEFAULT-}" P_DHCP_DEFAULT="${DHCP_DEFAULT-}"
P_DNS_RC_MANAGER_DEFAULT="${DNS_RC_MANAGER_DEFAULT-}" P_DNS_RC_MANAGER_DEFAULT="${DNS_RC_MANAGER_DEFAULT-}"
P_EBPF_ENABLED="${EBPF_ENABLED-no}"
P_FIREWALLD_ZONE="${FIREWALLD_ZONE-}" P_FIREWALLD_ZONE="${FIREWALLD_ZONE-}"
P_IWD="${IWD-}" P_IWD="${IWD-}"
P_LOGGING_BACKEND_DEFAULT="${LOGGING_BACKEND_DEFAULT-}" P_LOGGING_BACKEND_DEFAULT="${LOGGING_BACKEND_DEFAULT-}"
@ -396,7 +395,6 @@ meson setup\
-Dmodify_system=true \ -Dmodify_system=true \
-Dconcheck=true \ -Dconcheck=true \
-Dlibpsl="$(bool_true "$P_FEDORA")" \ -Dlibpsl="$(bool_true "$P_FEDORA")" \
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \
-Dsession_tracking=systemd \ -Dsession_tracking=systemd \
-Dsuspend_resume=systemd \ -Dsuspend_resume=systemd \
-Dsystemdsystemunitdir=/usr/lib/systemd/system \ -Dsystemdsystemunitdir=/usr/lib/systemd/system \

View file

@ -180,8 +180,6 @@ meson setup build \
-D crypto=$_WITH_CRYPTO \ -D crypto=$_WITH_CRYPTO \
-D docs=$_WITH_DOCS \ -D docs=$_WITH_DOCS \
\ \
-D ebpf=false \
\
-D iwd=true \ -D iwd=true \
-D ofono=true \ -D ofono=true \
-D teamdctl=$_WITH_LIBTEAM \ -D teamdctl=$_WITH_LIBTEAM \

View file

@ -477,19 +477,6 @@ if enable_selinux
endif endif
config_h.set10('HAVE_SELINUX', enable_selinux) config_h.set10('HAVE_SELINUX', enable_selinux)
# eBPF support
ebpf_opt = get_option('ebpf')
# 'auto' means 'false', because there are still issues.
if ebpf_opt != 'true'
enable_ebpf = false
else
enable_ebpf = true
if not cc.has_header('linux/bpf.h')
assert(ebpf_opt != 'true', 'eBPF requires kernel support')
enable_ebpf = false
endif
endif
# libaudit support # libaudit support
libaudit = get_option('libaudit') libaudit = get_option('libaudit')
enable_libaudit = libaudit.contains('yes') enable_libaudit = libaudit.contains('yes')
@ -1160,6 +1147,5 @@ output += 'have-nss: ' + crypto_nss_dep.found().to_string() + ')\n'
output += ' sanitizers: ' + get_option('b_sanitize') + '\n' output += ' sanitizers: ' + get_option('b_sanitize') + '\n'
output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n' output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n'
output += ' vapi: ' + enable_vapi.to_string() + '\n' output += ' vapi: ' + enable_vapi.to_string() + '\n'
output += ' ebpf: ' + enable_ebpf.to_string() + '\n'
output += ' readline: ' + with_readline + '\n' output += ' readline: ' + with_readline + '\n'
message(output) message(output)

View file

@ -44,7 +44,7 @@ option('nmcli', type: 'boolean', value: true, description: 'Build nmcli')
option('nmtui', type: 'boolean', value: true, description: 'Build nmtui') option('nmtui', type: 'boolean', value: true, description: 'Build nmtui')
option('nm_cloud_setup', type: 'boolean', value: true, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud') option('nm_cloud_setup', type: 'boolean', value: true, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud')
option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support') option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support')
option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support') option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support (deprecated)')
option('nbft', type: 'boolean', value: true, description: 'Enable NBFT support in the initrd generator') option('nbft', type: 'boolean', value: true, description: 'Enable NBFT support in the initrd generator')
# configuration plugins # configuration plugins

View file

@ -24,7 +24,7 @@ libn_acd = static_library(
'n-acd/src/n-acd.c', 'n-acd/src/n-acd.c',
'n-acd/src/n-acd-probe.c', 'n-acd/src/n-acd-probe.c',
'n-acd/src/util/timer.c', 'n-acd/src/util/timer.c',
enable_ebpf ? 'n-acd/src/n-acd-bpf.c' : 'n-acd/src/n-acd-bpf-fallback.c', 'n-acd/src/n-acd-bpf.c',
), ),
include_directories: include_directories( include_directories: include_directories(
'c-list/src', 'c-list/src',