Re: [PATCH net v2] bpf: Fix build when CONFIG_BPF_SYSCALL is disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> writes:

>> Thanks for the fix.
>>
>> But instead of moving this to core.c, you can probably make the btf.h
>> declaration conditional on CONFIG_BPF_SYSCALL, since this is not useful in
>> isolation (only used by verifier for module kfunc support). For the case of
>> kfunc_btf_id_list variables, just define it as an empty struct and static
>> variables, since the definition is still inside btf.c. So it becomes a noop for
>> !CONFIG_BPF_SYSCALL.
>>
>> I am also not sure whether BTF is useful without BPF support, but maybe I'm
>> missing some usecase.
>
> Unlikely. I would just disallow such config instead of sprinkling
> the code with ifdefs.

Is something like this what you have in mind?

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 6fdbf9613aec..eae860c86e26 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -316,6 +316,7 @@ config DEBUG_INFO_BTF
 	bool "Generate BTF typeinfo"
 	depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED
 	depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST
+	depends on BPF_SYSCALL
 	help
 	  Generate deduplicated BTF type information from DWARF debug info.
 	  Turning this on expects presence of pahole tool, which will convert


Cheers,
-- 
Vinicius



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux