On configs with CONFIG_BPF=y but CONFIG_BPF_SYSCALL=n (e.g. arm multi_v7_defconfig), kernel/bpf/core.c defines a __weak bpf_arena_handle_page_fault() while bpf_defs.h already supplies a static inline stub for it, causing a redefinition error. Build the __weak definition only under CONFIG_BPF_SYSCALL, matching the bpf_defs.h declaration and the CONFIG_BPF_SYSCALL-gated strong definition in arena.c.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -3376,13 +3376,14 @@ __weak u64 bpf_arena_get_kern_vm_start(struct bpf_arena *arena) · 3375 unmodified lines | ||
| 3376 | 3376 | { |
| 3377 | 3377 | return 0; |
| 3378 | 3378 | } |
| 3379 | + | |
| 3380 | +#ifdef CONFIG_BPF_SYSCALL | |
| 3379 | 3381 | __weak bool bpf_arena_handle_page_fault(unsigned long addr, bool is_write, |
| 3380 | 3382 | unsigned long fault_ip) |
| 3381 | 3383 | { |
| 3382 | 3384 | return false; |
| 3383 | 3385 | } |
| 3384 | 3386 | |
| 3385 | −#ifdef CONFIG_BPF_SYSCALL | |
| 3386 | 3387 | static int __init bpf_global_ma_init(void) |
| 3387 | 3388 | { |
| 3388 | 3389 | int ret; |