Some kconfigs can have BPF enabled without a single valid program type. In such configurations the build will fail with: ./kernel/bpf/btf.c:3466:1: error: empty enum is invalid Fix it by adding unused value to the enum.
Unified · Split
| @@ -3463,6 +3463,7 @@ enum { · 3462 unmodified lines | |||
| 3463 | __ctx_convert##_id, | 3463 | __ctx_convert##_id, |
| 3464 | #include <linux/bpf_types.h> | 3464 | #include <linux/bpf_types.h> |
| 3465 | #undef BPF_PROG_TYPE | 3465 | #undef BPF_PROG_TYPE |
| 3466 | __ctx_convert_unused, /* to avoid empty enum in extreme .config */ | ||
| 3466 | }; | 3467 | }; |
| 3467 | static u8 bpf_ctx_convert_map[] = { | 3468 | static u8 bpf_ctx_convert_map[] = { |
| 3468 | #define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \ | 3469 | #define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \ |