RE: [PATCH bpf] bpf: support pre-2.25-binutils objcopy for vmlinux BTF

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

 



Stanislav Fomichev wrote:
> If vmlinux BTF generation fails, but CONFIG_DEBUG_INFO_BTF is set,
> .BTF section of vmlinux is empty and kernel will prohibit
> BPF loading and return "in-kernel BTF is malformed".
> 
> --dump-section argument to binutils' objcopy was added in version 2.25.
> When using pre-2.25 binutils, BTF generation silently fails. Convert
> to --only-section which is present on pre-2.25 binutils.

hmm I think we should fail hard if a feature explicitly asked for
in the .config is not able to be built due to tooling. Otherwise
users may later try to use a feature that can only be supported by
BTF and that will have to fail at runtime. The runtime failure
seems more likely to surprise users compared to the inconvience
of having a compile time error. I view this similar to how having
old ssl libs fails the build with the various signing options are
set.

Can we print a useful help message instead so users can disable
CONFIG_DEBUG_INFO_BTF or update binutils?

> 
> Documentation/process/changes.rst states that binutils 2.21+
> is supported, not sure those standards apply to BPF subsystem.
> 
> Fixes: 341dfcf8d78ea ("btf: expose BTF info through sysfs")
> Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxx>
> ---
>  scripts/link-vmlinux.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)



[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