Skip to content

Commit

Permalink
bpf: Disallow BPF_PRELOAD in allmodconfig builds
Browse files Browse the repository at this point in the history
The CC_CAN_LINK checks that the host compiler can link, but bpf_preload
relies on libbpf which in turn needs libelf to be present during linking.
allmodconfig runs in odd setups with cross compilers and missing host
libraries like libelf. Instead of extending kconfig with every possible
library that bpf_preload might need disallow building BPF_PRELOAD in
such build-only configurations.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Alexei Starovoitov committed Aug 25, 2020
1 parent cd324d7 commit 2532f84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/bpf/preload/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ config USERMODE_DRIVER
menuconfig BPF_PRELOAD
bool "Preload BPF file system with kernel specific program and map iterators"
depends on BPF
# The dependency on !COMPILE_TEST prevents it from being enabled
# in allmodconfig or allyesconfig configurations
depends on !COMPILE_TEST
select USERMODE_DRIVER
help
This builds kernel module with several embedded BPF programs that are
Expand Down

0 comments on commit 2532f84

Please sign in to comment.